至少 只有解决思路

至少 只有at leastonly这两种条件用什么实现呢?[解决办法]至少有一条的select id ,name from tabwhere nam

至少 只有
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;

这样写可以吗