奇怪的排序问题
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
怎么办怎么办???
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
怎么办怎么办???
...全文
相关推荐
c++奇怪的魔塔
在“奇怪的魔塔”中,我们可能需要用到容器(如vector、list、set)来存储和管理游戏元素,算法(如排序、查找)来处理游戏逻辑,以及迭代器来遍历容器。
牛客 – 奇怪的背包问题增加了(贪心)
【奇怪的背包问题增加了(贪心)】是一个典型的动态规划或贪心算法问题,来源于牛客网的在线编程挑战。该题目要求解决一个背包问题,但具有一定的特殊性,适合用贪心策略来解决。
ORACLE-排序优化[归纳].pdf
排序过程中的“奇怪现象”可能指的是性能表现与预期不符的情况,比如在某些情况下,增加内存可能会导致更慢的排序速度,这是因为Oracle的排序算法可能因内存过大而倾向于使用磁盘排序,反而降低了效率。
浅谈MySQL排序原理与案例分析
**排序一致性问题** - 对于“奇怪”的排序现象,通常涉及到排序的一致性问题。这可能源于MySQL的内部优化策略,例如对排序结果的处理方式,以及在特定情况下如何平衡内存和磁盘资源。
河南省第五届大学生程序设计竞赛题目
### 河南省第五届大学生程序设计竞赛题目解析#### T1 奇怪的排序在**T1 奇怪的排序**问题中,我们遇到了一个由Dr.Kong设计的机器人Bill,它对自然数的理解与众不同,总是从右向左读数。


疑难问题
