首页 > 数据库技术 > 详细

T-SQL,LINQ取集合当中的重复项

时间:2016-03-07 18:36:42      阅读:209      评论:0      收藏:0      [点我收藏+]

T-SQL:

select * from Articles where Title in(Select Title From Articles Group By title Having Count(*) > 1) order by title

LINQ:

from t in Articles where 
(from t1 in Articles group t1 by t1.Title into groupT
where groupT.Count()>1 select groupT.Key).Contains(t.Title) orderby t.Title 
select t

 

T-SQL,LINQ取集合当中的重复项

原文:http://www.cnblogs.com/zooni/p/5251322.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!