SqlServer中Distinct和Top一起使用

SELECT distinct top  2  LastName FROM [dbo].[Employees] order by LastName

 distinct要放到top前面,这样取出的结果是先将数据Distinct去重复,然后再取其中的前两行

posted @ 2010-05-07 11:37  再快一点  阅读(11995)  评论(3编辑  收藏  举报