Question d’entretien chez eBay

What is the difference between left join and right join in SQL

Réponse à la question d'entretien

Utilisateur anonyme

1 mars 2012

The LEFT JOIN keyword returns all rows from the left table (table1), even if there are no matches in the right table (table2). SELECT column_name(s) FROM table1 LEFT JOIN table2 ON table1.column_name=table2.column_name The RIGHT JOIN keyword returns all the rows from the right table (table2), even if there are no matches in the left table (table1). SELECT column_name(s) FROM table1 RIGHT JOIN table2 ON table1.column_name=table2.column_name

1