HOW TO USE LEFT JOIN IN SQL?

314 viewsSQLSQL
0

HOW TO USE LEFT JOIN IN SQL?

Saraswat World Changed status to publish June 8, 2023
0
LEFT JOIN in SQL
LEFT JOIN in SQL

LEFT JOIN/LEFT OUTER JOINย clause select all the records from left table(table1) and the matching records from the right table(table2).

Syntax of LEFT JOIN in SQL-

SELECTย <column_name(s)>

FROMย <table1>

LEFT JOIN<table2>

ONย <table1.column_name=table2.column_name>

WHERE<condition>;

Example of LEFT JOIN in SQL-

SELECTย Customers.CustomerName, Orders.OrderID

FROMย Customers

LEFT JOINย Orders

ONย Orders.CustomerID = Customers.CustomerID;

LEFT JOIN returns all records from the left table (Customers), even if there are no matches in the right table (Orders). In the above example, SQL statement will select all customers and their orders.

Saraswat World Changed status to publish June 8, 2023
You are viewing 1 out of 1 answers, click here to view all answers.
Write your answer.

Posted

in

Tags:

Comments

Leave a Reply

Ganesh Ji Arti A Tribute to Dilip Kumar