Last answered:

25 Jun 2022

Posted on:

24 Jun 2022

0

Resolved: Any difference if changing the order of the tables around CROSS JOIN

Instead of the query you suggested in the solution, I ran the following, and got the same answer, I just wanted to make sure if the tables order matter with CROSS JOIN.

Thanks

SELECT
    m.*, d.*
FROM
    dept_manager m
        CROSS JOIN
    departments d
WHERE
    d.dept_no = 'd009'
ORDER BY m.emp_no;

1 answers ( 1 marked as helpful)
Instructor
Posted on:

25 Jun 2022

0

Hi Saeed!
Thanks for reaching out.

In the case where you use JOIN (INNER JOIN) and CROSS JOIN the order does not matter. But if you have LEFT JOIN or RIGHT JOIN the table order matters!

Note: Actually JOIN is the same as INNER JOIN.

Hope this helps.
Best,
Tsvetelin

Submit an answer