INNER JOIN clause select all the records from both the tables when there are the values matching between the specified columns.
Syntax of INNER JOIN in SQL-
SELECT <column_name(s)>
FROM <table1>
INNER JOIN<table2> ON <table1.column_name=table2.column_name>
WHERE<condition>;
Example of INNER JOIN in SQL-
SELECTOrders.OrderID, Customers.CustomerName
FROMOrders
INNER JOIN Customers
ON Orders.CustomerID = Customers.CustomerID;
โRecords in the Orders table that donโt have matches in the Customers table, then these orders will not be selected.
Leave a Reply