日期:2014-05-16 浏览次数:20706 次
SELECT COUNT(*) FROM A,B WHERE B.state=1 and A.state=0
------解决方案--------------------
两表是否有相同的KEY字段?
没有的话,产生笛卡乐积,
SELECT COUNT(*) FROM A,B WHERE B.state=1 and A.state=0
------解决方案--------------------
select count(*) from a inner join b on a.id=b.id and a.state=0 and b.state=1