对于union的sql语句 尽量做到同类归并
例如:
select ..
from A,B,C,D1
where conditon on D1
and (joins and other conditons)
union
select ..
from A,B,C,D2
where condtion on D2
and (joins and other conditons)
select ..
from
A,B,C,
(select .. from D1 where conditon on D1
union
select .. from D2 where condition on D2
)D
where joins and other conditons
浙公网安备 33010602011771号