我在访问中有一个名为DUAL的表。
我的查询是:
select * from
(select val(1) as NO from dual
union all
select val(3) as NO from dual
union all
select val(2) as NO from dual) a
order by No
结果:
NO
2
3
1
为什么 Order By No
运行不正常?
我想要的结果是
NO
1
2
3
非常感谢您
答案 0 :(得分:1)
我想NO是保留字,不需要外部查询,因此:
select val(1) as [NO] from dual
union all
select val(3) as [NO] from dual
union all
select val(2) as [NO] from dual
order by [NO]