Can i force mysql to perform subquery first?

后端 未结 5 1393
鱼传尺愫
鱼传尺愫 2020-12-30 12:07

I have query like this:

SELECT `table_1`.* from `table_1`
  INNER JOIN `table_2` [...]
  INNER JOIN `table_3` [...]
WHERE `table_1`.`id` IN(
  SELECT `id` FR         


        
5条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-30 12:45

    Unfortunately, no, you cannot. Subqueries are actually run once for each row in the outer query.

    I'd actually suggest that you convert this to another join, using table_1.id as your key to the other table.

提交回复
热议问题