我有一个结构如下的查询:
select (select first_name
from sub_table_1,
sub_table_2,
sub_table_3
where <where clause for sub_table 1,2,4>
and sub_table_1.col_1=table_1.col_1) first_name ,
(select last_name
from sub_table_1,
sub_table_2,
sub_table_3
where <where clause for sub_table 1,2,4>
and sub_table_1.col_1=table_1.col_1) last_name ,
<other select clause for table 1,2,3>
from table_1,
table_2,
table_3
where <Where clauses>
union
select (select first_name
from sub_table_1,
sub_table_2,
sub_table_3
where <where clause for sub_table 1,2,3>
and sub_table_1.col_1=table_4.col_1) first_name ,
(select last_name
from sub_table_1,
sub_table_2,
sub_table_3
where <where clause for sub_table 1,2,3>
and sub_table_1.col_1=table_4.col_1) last_name ,
<other select clause for table 4,5,6>
from table_4,
table_5,
table_6
where <Where clauses>
我想作为我是否参加:
(select first_name , last_name
from sub_table_1,
sub_table_2,
sub_table_3
where <where clause for sub_table 1,2,3>
and sub_table_1.col_1=table_4.col_1) first_name ,
(select last_name
from sub_table_1,
sub_table_2,
sub_table_3
where <where clause for sub_table 1,2,3> )
将帮助我使查询更快更好,否则会产生不利影响。
另请注意,此子查询可能会在其中获取大约 10000 条记录。
请帮忙