在sql i中,我使用join来获取distinct语句,如下所示
select distinct
col1
from
table1 a
inner join
table2 b on a.code = b.vcode
如何在linq over entity框架中实现相同的功能?
请推荐我。
最佳答案
var result = (from a in table1
join b in table2 on a.code equals b.vcode
select a.col1).Distinct();