4 ms·
A right join is also syntactic sugar for a left join
by bradleybuda 3y ago
A right join is also syntactic sugar for a left join
- bakuninsbart 3y agoExactly, that's why they shouldn't be used. If you feel the need to use a right join, swap the direction around. And only use inner joins if it is the only type of join you use, otherwise specify conditions in the where clause. Both serve to significantly lower mental overhead when dealing with queries. Natural joins are naturally more implicit, and while SQL tends to be a little bit verbose, given the significance of data integrity and the dififculty of testing SQL, the trade-off goes very clearly towards being explicit.