表名为score,其中有一字段为grade,用一条SELECT语句按grade从小到
大排序取前3条记录并按grade从大到小
排序(选所有字段)
按照如下写法:select * from (select top 3 * from score order by grade ) t order by grade desc;
总是出现下图提示:
------解决方案--------------------
select * from (select top 3 * from score order by grade ) t order by grade desc;
没有问题.
------解决方案--------------------
select * from (select top 3 * from score order by grade ) t order by grade desc;
------解决方案--------------------
做个视图,从视图里查。
另:没必要用两个ORDER
------解决方案--------------------
select * from (select top 3 * from score order by grade ) t ;
第二个order by 其实是没有用的,因为你(select top 3 * from score order by grade )已经排序了。不过语法上没有什么问题,可能PB不支持此类型的写法吧。