Using two tables in a from clause is functionally equivalent to cross join :
select * from A cross join B
This returns row A for each row in B. When B is empty, the result is also empty. You can fix this using left join . With left join you can return rows even if one of the tables is empty. For example:
select * from A left join B on 1=1
Since the condition 1=1 always true, this is similar to a cross join , except that it also works for empty tables.
Andomar
source share