我想用一SQL语法选择重复的值出来
   例如:有一字段(hwh)值为
                    2
                    2
                    3
                    3
                    4
                    5 
                    6          我要取得 2
                  3
各位高手帮帮忙!在线等待

解决方案 »

  1.   

    select distinct(hwh)
    from
    (select hwh,count(hwh) as a 
     from   mytable
     group by hwh
     having by count(hwh)>1)New_Table;
    Good Luck
      

  2.   

    select hwh from (select hwh, count(hwh) from tablename group by hwh having by count(hwh)>1)
      

  3.   

    having 不要加 BY
    但谢谢上面俩位
      

  4.   

    select count(hwh) from (select hwh,count(hwh) as a from hwb group by hwh having count(hwh)>1) hwb