How to make LEFT JOIN depend on a further INNER JOIN - ( Filtering a left join further )

in slq •  4 years ago 

Below is how to make LEFT JOIN depend further on an INNER JOIN. Below is an example of "using LEFT JOIN and INNER JOIN in the same query":

SELECT *
FROM TableFoo tf1
LEFT JOIN (TableBar tb1
INNER JOIN TableBaz tb2 ON tb2.id = tb1.baz_id
) ON
tb1.id = tf1.bar_id

In this example, tb1 will only be included if tb2 is also found.

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!