Will
Will

Reputation: 2978

Oracle SQL Syntax: Select

Are the following sql statement valid in Oracle SQL?

1)

select 1

2)

select test from (select 1 as test)

3)

select test from (select 1 as test) s

Thanks in advance!

Best, Will

Upvotes: 1

Views: 351

Answers (1)

Lukas Eder
Lukas Eder

Reputation: 220987

None of them are valid. These are the correct statements:

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

Upvotes: 6

Related Questions