日期:2014-05-17 浏览次数:20486 次
SELECT a.* FROM A a WHERE EXISTS (SELECT 1 FROM B b WHERE A.id=b.id AND a.[日期]<=b.[日期])
------解决方案--------------------
SELECT A.* FROM A,B
WHERE A.id=B.Id AND A.日期<b.日期
------解决方案--------------------
select A.* from A ,B where A.日期<=B.日期 and A.id=B.id
------解决方案--------------------
--查询A表符合条件的有多少条记录 SELECT count(a.*) FROM A a WHERE EXISTS (SELECT 1 FROM B b WHERE a.id=b.id AND a.[日期]<=b.[日期])