29. 查询某个字段重复的记录

Posted on 2016-06-07 10:33  zkx4213  阅读(131)  评论(0)    收藏  举报

这里是查询tcalendar表ID值相同的记录

select * from tcalendar where id in (
  select id from tcalendar t where t.id in (
    select t1.id from tcalendar t1 group by t1.id having count(*) >1
  )
) order by id asc

博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3