Answers for "INNER JOIN with two condtion"

SQL
0

merge clause with inner join

MERGE table1
USING (SELECT table3.keycolumn,
              table2.DataColumn1,
              table2.DataColumn2
       FROM table2
       INNER JOIN table3
           ON table2.anotherKey = table3.anotherKey
       WHERE table2.anotherKey = 'A1') tmpTable
ON 
   table1.keyColumn = tmpTable.keyColumn
WHEN MATCHED THEN
       UPDATE
       SET table1.DataColumn1 = tmpTable.DataColumn1
            ,table1.DataColumn2 = tmpTable.DataColumn2;
Posted by: Guest on May-12-2020
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 "INNER JOIN with two condtion"

Code answers related to "SQL"

Browse Popular Code Answers by Language