C# SQL Statement transformed TO LINQ how can i translate this statement to a working linq
Posted
by BlackTea
on Stack Overflow
See other posts from Stack Overflow
or by BlackTea
Published on 2010-03-05T22:53:03Z
Indexed on
2010/03/08
0:30 UTC
Read the original article
Hit count: 690
I am having trouble with this I have 3 Data tables i use over and over again which are cached I would like to write a LINQ statement which would do the following is this possible?
T-SQL VERSION:
SELECT P.[CID],P.[AID]
,B.[AID], B.[Data], B.[Status], B.[Language]
FROM MY_TABLE_1 P
JOIN
(
SELECT A.[AID], A.[Data], A.[Status], A.[Language] FROM MY_TABLE_2 A
UNION ALL
SELECT B.[AID], B.[Data], B.[Status], B.[Language] FROM MY_TABLE_3 B
) B on P.[AID] = B.[AID]
WHERE B.[Language] = 'EN' OR B.[Language] = 'ANY' AND B.STATUS = 1 AND B.[Language] = 'EN' OR B.[Language] = 'ANY' AND B.STATUS = 1
Then i would like it to create a result set of the following
Results: |CID|AID|DATA|STATUS|LANGUAGE
© Stack Overflow or respective owner