[Solved] MySQL use select for LEFT JOIN ON


Theoretically you can do this.

Writing subquery in join statement will have no effect other than filtering the cartesian product of the two tables just like the where condition. But writing query this way makes no sense as we don’t know the context in which you are using it.

The above query can be written in much cleaner way as follows :

SELECT
  t1.id,
  t1.name
FROM t1, t2
WHERE t2.id in (SELECT id FROM t3 WHERE address LIKE 'street%') 
ORDER BY name DESC

It will produce the same result set as the query you provided

0

solved MySQL use select for LEFT JOIN ON