日期:2014-05-17  浏览次数:20665 次

至少 只有
at least 
only
这两种条件用什么实现呢?

------解决方案--------------------
至少有一条的
select id ,name from tab
where name='a'
group by id
having count(name)>1
------解决方案--------------------
探讨
select * from a where (select count(*) from b where a.i=b.i)=1;
select * from a where (select count(*) from b where a.i=b.i)>0;

这样写可以吗