查找表中重复数据:

select * 
  from channel 
 where channelname in
 (
    select channelname 
      from channel 
     group by channelname 
    having (count(*) > 1)
 ) 

 

查找channel表中channelname重复的所有数据。
having也是很有用的啊