Inner Join

From rbachwiki
Revision as of 14:07, 1 November 2017 by Bacchas (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

A join of two or more tables that returns only the matched rows is called an inner join

SELECT sales.sales_date, sales.order_id, sales.product_id, product.product_name
FROM sales INNER JOIN product
ON sales.product_id = product.product_id;

OR

SELECT A.sales_date, A.order_id,  A.product_id, B.product_name
FROM sales A INNER JOIN product B
ON A.product_id = B.product_id ;
SALES_DATE     ORDER_ID  PRODUT_ID   PRODUCT_NAME
01-FEB-15	1269	  200	      Samsung F7100
01-JAN-15	1267	  100	      Mobile Cover
01-JAN-15	1267	  101	      iPhone
02-JAN-15	1268	  100	      Mobile Cover
09-FEB-15	1270	  105	      HTC 7800
09-FEB-15	1270	  106	      Microsoft Keyboard 7865
09-FEB-15	1270	  101	      iPhone

Back To Top- Home - Category