HOW TO USE INNER JOIN IN SQL

INNER JOIN in SQL

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-

SELECT Orders.OrderID, Customers.CustomerName

FROM Orders

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

Your email address will not be published. Required fields are marked *