SQL Language (MOSC)

MOSC Banner

select something, *

edited Feb 24, 2012 1:24AM in SQL Language (MOSC) 6 commentsAnswered
Why does the following  statement give an error?

select 1 , * from dual;


select 1 , * from dual
           *
ERROR at line 1:
ORA-00936: missing expression

(The original statement made sense, but it also goes wrong with this simpler version.)

This is supposed to work and does with other database platforms.

But it does go wrong in both Oracle 11.2.0.1 and 10.2.0.5

The following does work:

select 1,dual.* from dual;

It is almost as if * is seen as the  multiplier sign.

It is the expected error here:
SQL> select 1* from dual;
select 1* from dual
          *
ERROR at line 1:
ORA-00936: missing expression

Here the same error makes sense.

Does anybody understand why select 1, * from dual  goes wrong?

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center