Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I have the following SQL query and I need to have it in LINQ, I tried several things but I can not get it working.

Here is the SQL query

SELECT     ST.Description, ST.STId, COUNT(SI.SIId) AS Expr1
FROM         BP INNER JOIN
                      MbrBP ON BP.BPId = MbrBP.BPId INNER JOIN
                      SI ON BP.BPId = SI.BPId RIGHT OUTER JOIN
                      ST ON SI.STId = ST.STId
WHERE     (BP.CountryId = 1) AND (BP.RegionId = 1) AND (MbrBP.MemberId = 1)
      AND (SI.IsActive = 1)
GROUP BY ST.Description, ST.STId
UNION 
SELECT      ST.Description, ST.STId, COUNT(SI.STId) AS Expr1
FROM         SI RIGHT OUTER JOIN
                      ST ON SI.STId = ST.STId
GROUP BY ST.Description, ST.STId
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
184 views
Welcome To Ask or Share your Answers For Others

1 Answer

Have you tried Linqer http://www.sqltolinq.com

An SQL-> LINQ converter..

Or LINQPad http://www.linqpad.net/


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...