奇怪的排序问题
select * from (select a.itemid,b.itemname,a.result,c.itemvaluemin,c.itemvaluemax,h.showorder aaaa
from ( select C as result,'112' as itemid from exp_taelement where id=40
union all select Si as result,'113' as itemid from exp_taelement where id=40
union all select Mn as result,'100' as itemid from exp_taelement where id=40
union all select P as result,'108' as itemid from exp_taelement where id=40
union all select S as result,'105' as itemid from exp_taelement where id=40
union all select Cr as result,'114' as itemid from exp_taelement where id=40
union all select Ni as result,'115' as itemid from exp_taelement where id=40
union all select Ca as result,'125' as itemid from exp_taelement where id=40
union all select Al as result,'117' as itemid from exp_taelement where id=40
union all select Cu as result,'118' as itemid from exp_taelement where id=40
union all select Alsol as result,'126' as itemid from exp_taelement where id=40
union all select V as result,'120' as itemid from exp_taelement where id=40
union all select W as result,'121' as itemid from exp_taelement where id=40
union all select B as result,'122' as itemid from exp_taelement where id=40
union all select Sn as result,'123' as itemid from exp_taelement where id=40
union all select as1 as result,'124' as itemid from exp_taelement where id=40) a
join (select * from openquery(ora9qc,'select * from qc.bd_citem')) b
on a.itemid=b.itemid
left join (select * from openquery(ora9qc,
'select itemid,itemvaluemin,itemvaluemax from bd_cstdetail a join bd_cstandard b on a.cstid=b.cstid where a.cstid=''00000007''')) c
on a.itemid=c.itemid
left join (select * from data_tranmodule where stkid is null) h
on a.itemid=h.itemid) aaa order by aaaa
---
100 Mn 1.3700000000000001 1.2 1.6 2.0
105 S 2.9000000000000001E-2 0 .045 5.0
108 P 4.3999999999999997E-2 0 .045 4.0
112 C 0.20200000000000001 .17 .25 1.0
113 Si 0.63 .4 .8 3.0
114 Cr 5.9999999999999998E-2 0 .3 6.0
115 Ni 4.0000000000000001E-2 0 .3 7.0
117 Al 3.0000000000000001E-3 NULL NULL 9.0
118 Cu 0.11 0 .3 8.0
120 V 0.0 NULL NULL 12.0
121 W 0.0 NULL NULL 13.0
122 B 0.0 NULL NULL 14.0
123 Sn 0.0 NULL NULL 15.0
124 As1 0.0 NULL NULL 16.0
125 Ca 0.0 NULL NULL 11.0
126 Alsol 0.0 NULL NULL 10.0
语句后加上 order by aaa,结果就只有一条记录了,排序列值就是最后一列--
112 C 0.20200000000000001 .17 .25 1.0
不知道为什么,已经安装了sp4了,虽说select @@version还是sp2
怎么办怎么办???