如何选择EF中的所有分组字段字段

时间:2016-05-20 17:55:26

标签: sql entity-framework

如何在EF中编写此SQL代码:

我想选择重复记录的所有字段 SQL中的这段代码工作正常,但我不知道在实体框架中编写它

select o.* from MyTable o inner join
(
    select ColDb1,ColDb2,ColDb3 from MyTable
    where ColDb0 = 0
    group by ColDb1,ColDb2,ColDb3
    having count(*) > 1
) x
on o.ColDb1 = x.ColDb1
and o.ColDb2 = x.ColDb2
and o.ColDb3 = x.ColDb3

0 个答案:

没有答案