Showing posts with label join. Show all posts
Showing posts with label join. Show all posts

Saturday, 14 May 2016

How to full join in sql

SELECT Client.ClientName, Product.ProductID
FROM Client
FULL OUTER JOIN Product
ON Client.ClientID=Product.ClientID
ORDER BY Client.ClientName;

How to right join in sql

SELECT Product.ProductID, Client.Name
FROM Product
RIGHT JOIN Client
ON Product.ClientID=Client.ClientID
ORDER BY Product.ProductID;

How to left join in sql

SELECT Client.ClientName, Product.ProductID
FROM Client
LEFT JOIN Product
ON Client.ClientID=Product.ClientID
ORDER BY Client.ClientName;

How to table join in sql

SELECT Product.ProductID, Client.ClientName, Product.ProductDate
FROM Product
INNER JOIN Client
ON Product.ClientID=Client.ClientID;