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

in #slq4 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.

Coin Marketplace

STEEM 0.19
TRX 0.25
JST 0.038
BTC 97262.35
ETH 3392.76
USDT 1.00
SBD 3.02