Home > Net > How to convert the following SQL statement to linq statement
How to convert the following SQL statement to linq statement
Time:09-19
select TD. TD001 order sheet no, TD TD002 order number, TD TD003 order serial number, TD. TD004 article number, TD TD005 name, TD TD006 specifications, TD TD007 warehouse, TC TC004 customer number, TC TC012 customer PO, TC TC003 order date, TH. TH008 delivery quantity, MC. MC007 inventory quantity The from BW_COPTD AS TD LEFT the JOIN BW_INVMC AS MC ON MC. MC001=TD. TD004 AND MC. MC002=TD. TD007 Left the join BW_COPTC as TC ON TC TC001=TD. TD001 AND TD. TD002=TC TC002 Left the join BW_COPTH AS TH ON TD. TD001=TH. TH001 AND TD. TD002=TH. TH002 AND TD. TD003=TH. TH003
CodePudding user response:
You know about the defaultIfEmpty https://www.cnblogs.com/sjqq/p/8385326.html
CodePudding user response:
To clarify first table, the relationship between the linq several keyword syntax similar to SQL,
CodePudding user response:
This is just simple ` LEFT JOIN ` for LINQ, Check the samples on the MSDN: https://docs.microsoft.com/en-us/dotnet/csharp/linq/perform-left-outer-joins