LINQ 구문 GROUP BY 사용해 보기

LINQ 구문으로 GROUP BY 를 통해 MULTI 멀티 필드 FIELD 가져오기

 

SQL 구문

SELECT CompanyID, UserID FROM UNIV_BOA_Lists WHERE CompanyID = 1 AND UserID = 1
GROUP BY CompanyID, UserID

 

LINQ 구문

from u in UNIV_BOA_Lists
where u.CompanyID == 1 && u.UserID == 1
group u by new { u.CompanyID, u.UserID } into g
select new {g.Key.CompanyID, g.Key.UserID }

 

TAGS.

Comments 2