查询得到一字段数据,再得出百份比后进行order by 字段 desc排序,但结果却是没有顺序的
语句如下:
SELECT Cint((iJiaCount/((select count(*) from tisi where iJia=iJia2)+1))*100) AS BaiFeng, laymu.sMuName AS sName
FROM [SELECT iJia AS iJia2, count(*) AS iJiaCount
FROM Tisi, sGuo
WHERE Tisi.iA=sGuo.iA and Tisi.iChan=sGuo.iChan
GROUP BY Tisi.iJia]. AS [%$##@_Alias], Laymu
WHERE laymu.id=iJia2
ORDER BY 1 DESC;
BaiFeng 字段里的数据全是两位的整数,但却排不了序.
BaiFeng 字段数据
24
22
21
19
18
24
18
23
21
20
20
19
19
17
17
28
24
21
17
14
10
求高手赐教!!!
------解决方案--------------------SELECT Cint((iJiaCount/((select count(*) from tisi where iJia=iJia2)+1))*100) AS BaiFeng, laymu.sMuName AS sName
FROM [SELECT iJia AS iJia2, count(*) AS iJiaCount
FROM Tisi, sGuo
WHERE Tisi.iA=sGuo.iA and Tisi.iChan=sGuo.iChan
GROUP BY Tisi.iJia]. AS [%$##@_Alias], Laymu
WHERE laymu.id=iJia2
ORDER BY baifeng DESC