From the course: Oracle Database 12c: Basic SQL

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

LEFT JOIN

LEFT JOIN - Oracle Database Tutorial

From the course: Oracle Database 12c: Basic SQL

Start my 1-month free trial

LEFT JOIN

- [Instructor] The left join in the SQL language is used to return all rows from the left table, that is, the employees tables in our case, as well as matched rows from the right table, that is the departments table in our case. In order to run a left join, you simply type left join as part of the front clause of your SQL command. So for example, you can select your data from employees, left join on departments. In this case, we will retrieve all records from the employees tables, as well as matching records from the department tables. However, there might be null values returned from the departments table, because if no matching rows exist between employees and departments, we will still get these rows from the employees table. That's because we are running a left join. So enough talk, let's see left joins in action. We can actually use the same exact SQL query from our previous video, with one small modification. We change inner join to left join. Let's execute this query and see…

Contents