求助:如何从两张表中同时取数据
两张表的结构一样,select * from tab1 where date="20080701" order by date;
select * from tab2 where date="20080701" order by date;
我想用一个语句就完成以上功能,请问该如何写这个sql?
回复 #1 ccb_bee 的帖子
滤掉重复行:select * from tab1 where date="20080701" order by date;
union
select * from tab2 where date="20080701" order by date;
保留所有行:
select * from tab1 where date="20080701" order by date;
union all
select * from tab2 where date="20080701" order by date;
页:
[1]