- MySQL 8 for Big Data
- Shabbir Challawala Jaydip Lakhatariya Chintan Mehta Kandarp Patel
- 87字
- 2021-08-20 10:06:13
INNER JOIN
This join returns records matching in both tables and returns relevant records. For example, the Order table used in any Ecommerce applications:

For example, the Customer table used in ecommerce application which consists Customer data:

The following query would fetch all order records with customer details. As the customer IDs 37 and 77 are not present in the customer table, it will fetch only the matching rows excluding customer IDs 37 and 77:
SELECT order.order_id, customer.name
FROM order
INNER JOIN customer ON order.customer_id = customer.customer_id;