Microsoft Access中的使用顺序

时间:2018-08-08 02:00:27

标签: ms-access

我在访问中有一个名为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

非常感谢您

1 个答案:

答案 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]