怎么同时取两个相同结构数据表的数据啊?
如两个文章表: Article_1 Article_2表结构一样,如果取一个表中“盖茨他爹”的文章数用
select count(*) from Article1 where username='盖茨他爹'
如果同时统计两个表中的文章数呢?
2006-04-29 20:59
我的问题太简单了
2006-04-30 14:55
2006-04-30 15:35
2006-04-30 21:02
找到了,
[QUOTE]select * from table where field='条件' union all select * from table2 where field='条件'
把条件写两遍即可
select * from (select * from table union all select * from table2 ) as a where a.field='条件'
写一遍也可以[/QUOTE]
2006-04-30 21:06
2006-04-30 21:06
2006-05-02 15:18
2006-05-22 12:51
2006-05-22 13:57
2006-05-23 12:31