Oracle SQL语法:选择

时间:2011-06-09 08:54:28

标签: sql oracle select

以下sql语句在Oracle SQL中是否有效?

1)

select 1

2)

select test from (select 1 as test)

3)

select test from (select 1 as test) s

提前致谢!

最佳, 将

1 个答案:

答案 0 :(得分:6)

它们都不是有效的。这些是正确的陈述:

1)

select 1 from dual

2)

select test from (select 1 as test from dual)

3)

select test from (select 1 as test from dual) s
-- or also
select s.test from (select 1 as test from dual) s