2
  1. 加入一个表本身是没有问题的。但是我需要自己加入一个创建的选择。第一个想法:使用临时表,但我只能打开一次。这是真的?

  2. MySQL 是否足够聪明,可以计算始终只有一次相同术语的子选择?例如:

    join (select * from asdf where term) as one
    join (select * from asdf where term) as two
    ...
    join (select * from asdf where term) as ten
    

一般是怎么解决的?

4

1 回答 1

2

您可以多次加入临时表

    select * into #temp from asdf where term
    ...
    join #temp as one
    join #temp as two
    ...
    join #temp as ten
于 2013-02-12T12:07:22.097 回答