Difference between revisions of "Inner Join"
Jump to navigation
Jump to search
Line 5: | Line 5: | ||
ON sales.product_id = product.product_id; | ON sales.product_id = product.product_id; | ||
01-FEB-15 1269 200 Samsung F7100 | SALES_DATE ORDER_ID PRODUT_ID PRODUCT_NAME | ||
01-JAN-15 1267 100 Mobile Cover | 01-FEB-15 1269 200 Samsung F7100 | ||
01-JAN-15 1267 101 iPhone | 01-JAN-15 1267 100 Mobile Cover | ||
02-JAN-15 1268 100 Mobile Cover | 01-JAN-15 1267 101 iPhone | ||
09-FEB-15 1270 105 HTC 7800 | 02-JAN-15 1268 100 Mobile Cover | ||
09-FEB-15 1270 106 Microsoft Keyboard 7865 | 09-FEB-15 1270 105 HTC 7800 | ||
09-FEB-15 1270 101 iPhone | 09-FEB-15 1270 106 Microsoft Keyboard 7865 | ||
09-FEB-15 1270 101 iPhone | |||
[[#Select Command|Back To Top]]-[[Main_Page| Home]] - [[Oracle_SQL|Category]] | [[#Select Command|Back To Top]]-[[Main_Page| Home]] - [[Oracle_SQL|Category]] |
Revision as of 14:00, 1 November 2017
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;
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