求教SQL语句! select a.xsbh from a,bwhere a.xsbh = b.xsbh group by a.xsbh having count(b.好事) >= 3; 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select xsbhfrom bgroup by xsbhhaving count(*) > 3 select xsbh from bgroup by xsbhhaving count(xsbh)>3 或者这样,效率会好点.少用having:select xsbhfrom b,(SELECT xsbh COUNT(1) cc FROM b GROUP BY xsbh) aWHERE a.xsbh=b.xsbh AND cc>3 select a.* from a,(select xsbh,count(*) as n from b group by xsbh) c where a.xsbh=c.xsbh and n>3 select a.*from awhere exists (select b.xsbh from b where a.xsbh = b.xsbh group by b.xsbh having count(b.xsbh)>3) sos_help(浊世清风) 的写法可以实现,不过效率不高,如果按我这样写的话,执行效率会高一些的 IMP00017 求解决 Oracle数据库服务器登录长用户名缓冲区溢出漏洞 ORACLE释放undo表空间 vc 编译PROC时提示错误,为什么? 这个存储过程哪里写错了? oracle从三个变量中选出最大值 SELECT 语句中缺少 INTO 子句 安装Oracle9i后,无法启动EnterpriseManager Console 一个中文汉字,在ORACLE中到底占几个字节? 数据库的服务起不来 怎么删除(从服务里)有可以不重新安装的办法吗? 在线 面试时遇到两个oracle的问题,帮忙解答一下 在win98上安装oracle8i个人版后无法启动数据库
from b
group by xsbh
having count(*) > 3
group by xsbh
having count(xsbh)>3
select xsbh
from b,(SELECT xsbh COUNT(1) cc FROM b GROUP BY xsbh) a
WHERE a.xsbh=b.xsbh
AND cc>3
from a,(select xsbh,count(*) as n from b group by xsbh) c
where a.xsbh=c.xsbh and n>3
from a
where exists (select b.xsbh from b where a.xsbh = b.xsbh
group by b.xsbh
having count(b.xsbh)>3)