select col1
      from table1 group by col1 having count(col1)=1
union all
select col1
      from table1 group by col1 having count(col1)>1

解决方案 »

  1.   

    select col1
          from table1 group by col1 having count(col1)>=1
      

  2.   

    (select col1 from table1 group by col1 having count(col1)=1)
    union
    (select col1 from table1 group by col1 having count(col1)>1)如果允许重复的记录,在union 后边加上 all
      

  3.   

    同意AliceFeel.select col1
    from table1 
    group by col1 
    having count(col1)>=1
      

  4.   

    up WangZWang(阿来)
    select col1
          from table1 group by col1 having count(col1)=1
    union all
    select col1
          from table1 group by col1 having count(col1)>1
      

  5.   

    已经有答案了, WangZWang(阿来) 明白了小弟的意思的,谢谢。
    有星是厉害。
    马上结贴