请教一个查询问题 假设有两个表A,B,都有字段id,name,怎样查询表A表B中查询name中含有“张”的记录,并且知道该记录是那一个表中的。比如A表中有id=5,name="张三",B表中有id=8,name="张四",并且在查询结果中知道“张三”是表A中的记录。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select id,name,'A' as tblNamefrom Awhere name like "张%"union allselect id,name,'B' as tblNamefrom Bwhere name like "张%" == 思想重于技巧 == select * from (select a.*,A from Aunion allselect b.*,B from b)as temp where temp.id like '%张%' Cannot create PoolableConnectionFactory mysql查询速度 问一条比较复杂的sql语句 也提一个时间问题,查询生日 求WHILE循环写法!!急!!!加班中!!1 一个只有0或者1两种值的列有必要加索引吗? 急!!哪儿可以下到mysql3.23.41在linux下的驱动程序啊? 请问:哪里有5.0版的mysql下载? 我在其网站上只找到 了alpha版! Mysql中要改变数据库名用什么语句? 大家帮忙看看,这个结果如果在mysql下得到 关于postgresql中的dblink.sql mysql 批量替换 内容?
from A
where name like "张%"
union all
select id,name,'B' as tblName
from B
where name like "张%"
select a.*,A from A
union all
select b.*,B from b)
as temp where temp.id like '%张%'