标签: sql linq group-by having-clause
如何将此查询从SQL写入LINQ:
SELECT * FROM table WHERE np in ( SELECT np FROM table GROUP BY np HAVING COUNT(np) > 1
答案 0 :(得分:1)
这样的事情:
<Table>.GroupBy(x => x.np) .Where(x => x.Count() > 1) .SelectMany(x => x)