展开全部
之前查出的结果集 是什么内容啊?,说不定你写错了返回的结果集不一62616964757a686964616fe58685e5aeb931333335323536样。 不能先保存在临时表里再查?
我试过你这个语句看起来是没有问题的。但不知道FP 这个是怎么得来的,是什么样的字段类型。select tb1.FP ,
(select COUNT(distinct(tb2.FP))+1
from
(
select '14.29%' FP
union all
select '42.86%' FP
union all
select '28.57%' FP
union all
select '14.29%' FP
) tb2
where tb2.FP>tb1.FP
) as PM
from
(
select '14.29%' FP
union all
select '42.86%' FP
union all
select '28.57%' FP
union all
select '14.29%' FP
) tb1
order by PM