oracle 查出一个表中字段值出现次数大于2的所有记录

表web_order  列 name ,businesscode, a.account

周桥 18929609222 3754031157710000
妙药 18929609233 3754031157712344
灵丹 18929609189 3754031157710000
周桥 13329609189 3754031157713333

查出一个表中account 出现次数大于2的所有记录

select a.name ,a.businesscode, a.account
from web_order a,
     (select b.account,count(b.account) as count
      from web_order b
      group by b.account
      having count(b.account)>300
      ) c
where a.account=c.account

 

不重复显示

name,bsinesscode,account 并加一列count(account)
select min(a.name) ,min(a.businesscode),a.account, count(a.account)
from web_order a where 1=1
group by a.account
having count( a.account)>=100

你可能感兴趣的:(oracle 查出一个表中字段值出现次数大于2的所有记录)