小编csh*_*oob的帖子

Converting SQL Query into Linq (c#) with Distinct

I am trying to write my SQL Statement with Linq, but I don't quite get it. I know there are many familiar posts, but maybe you can help me with mine and help me to understand how it works.

My SQL Query:

SELECT DISTINCT(cou.Country1) AS Laender, COUNT(cou.Country1) AS Anzahl FROM SEC_User be
INNER JOIN PAR_Company com ON com.CompanyID = be.CompanyID
INNER JOIN DAT_Country cou ON cou.CountryID = com.CountryID
Group by cou.Country1
Run Code Online (Sandbox Code Playgroud)

I think my start might be right:

var query …
Run Code Online (Sandbox Code Playgroud)

c# sql linq linq-to-entities entity-framework

1
推荐指数
1
解决办法
68
查看次数

标签 统计

c# ×1

entity-framework ×1

linq ×1

linq-to-entities ×1

sql ×1