Sql过滤重复记录

select * from z_leave where z_id in -- 检索重复z_linkname的纪录
(select max(z_id) from z_leave where z_linkname in -- 求重复z_id的其中一个z_id
(select z_linkname from z_leave group by z_linkname having count(1) >= 1) -- 取出重复的z_linkname
group by z_linkname
) 
posted @ 2012-12-03 11:59  蜗牛、、、  阅读(152)  评论(0)    收藏  举报