日期:2014-05-17 浏览次数:20855 次
select A.name from A,B where A.code=B.Code group by A.name having count(distinct A.code) < (select count(*) from B)
------解决方案--------------------
select A.name from A,B where A.code=B.Code group by A.name having count(distinct A.code)=(select count(1) from B)
------解决方案--------------------
select A.name from A group by A.name having count(distinct A.code) < (select count(*) from B)
------解决方案--------------------
select * from a group by name,code_name having count(*)<(select count(*) from b)
------解决方案--------------------
select A.name
from A
join B on A.code=B.code
group by A.name
having count(distinct A.code) < (select count(*) from B)
------解决方案--------------------
select A.name
from A
where A.code in (select code from B)
group by A.name
having count(distinct A.code) <(select count(1) from B)
-------------------------
select distinct A1.name
from A A1
where exists(select * from B where B.code not in(select code from A A2 where A2.name=A1.name))
------解决方案--------------------
select name from A where (select count(name) from A where a.code='001' and b.code='002')<2