Pregunta de entrevista de eBay

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

Respuesta de la entrevista

Anónimo

1 mar 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