MySQL correlated subquery in JOIN syntax

后端 未结 5 1841
深忆病人
深忆病人 2020-12-30 01:34

I would like to provide a WHERE condition on an inner query by specifying innertable.id = outertable.id. However, MySQL (5.0.45) reports \"Unknown column \'outertable.id\' i

5条回答
  •  执笔经年
    2020-12-30 02:02

    I would write it with multiple joins. When you say that it "would possibly incur additional overhead" that tells me that you haven't tested it to be sure. If you have decent indexes the joins should be pretty trivial.

    This also shows just one of the pitfalls of the generic "hold everything" table design pattern.

提交回复
热议问题