Answers for "multiple conditions for join sql"

SQL
0

INNER JOIN On Multiple Conditions

var q=(from pd in dataContext.tblProducts 
 join od in dataContext.tblOrders on pd.ProductID equals od.ProductID 
 join ct in dataContext.tblCustomers 
 on new {a=od.CustomerID,b=od.ContactNo} equals new {a=ct.CustID,b=ct.ContactNo} 
 orderby od.OrderID 
 select new { 
 od.OrderID,
 pd.ProductID,
 pd.Name,
 pd.UnitPrice,
 od.Quantity,
 od.Price,
 Customer=ct.Name //define anonymous type Customer
 }).ToList();
Posted by: Guest on June-08-2021

Code answers related to "multiple conditions for join sql"

Code answers related to "SQL"

Browse Popular Code Answers by Language