For example we have the following SQL query
select T1.name
from table1 T1
join table2 T2 ON T1.id = T2.id
I have made join table2 only if it is NOT empty. If table2 is empty I don't make join
select T1.name
from table1 T1
Can I solve it by one SQL query? It would be good to use only SQL standard.