去除列中有重复的行,保留一行

1.UserID 并非主键,UserID有重复值

SELECT b.*
FROM
(
SELECT*,rid=ROW_NUMBER() OVER(PARTITION BY UserID ORDER BY UserID) FROM EmployeeAllInfo
) b
WHERE rid =1

posted @ 2012-09-04 11:04  偶不是大叔  阅读(285)  评论(0编辑  收藏  举报