比如表A中有数据
a
b
c
b
c
c
我想要的结果是
b
b
c
c
c
那语句该怎么写...看到过网上用
select a from table where a in(select a from table group by a having count(a)>0)
或者
select a from table group by a having count(a)>0
但是,我怎么用,都没有效果吶...

解决方案 »

  1.   

    加上all关键字嘛
    比如:select all a from table group by a having count(a)>0
      

  2.   

    只要你了解group by 和having,肯定能查
      

  3.   

    select a from table where a in(select a from table group by a having count(a)>0)
    为什么是大于0而不是大于1
    select a from table where a in(select a from table group by a having count(a)>1)