INNER JOIN in SQL

HOW TO USE 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-

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.


Posted

in

Tags:

Comments

Leave a Reply