Why is selecting specified columns, and all, wrong in Oracle SQL?

Posted by TomatoSandwich on Stack Overflow See other posts from Stack Overflow or by TomatoSandwich
Published on 2010-02-23T00:17:35Z Indexed on 2010/06/16 23:42 UTC
Read the original article Hit count: 160

Filed under:
|
|

Say I have a select statement that goes..

select * from animals

That gives a a query result of all the columns in the table.

Now, if the 42nd column of the table animals is is_parent, and I want to return that in my results, just after gender, so I can see it more easily. But I also want all the other columns.

select is_parent, * from animals

This returns ORA-00936: missing expression.

The same statement will work fine in Sybase, and I know that you need to add a table alias to the animals table to get it to work ( select is_parent, a.* from animals ani), but why must Oracle need a table alias to be able to work out the select?

© Stack Overflow or respective owner

Related posts about sql

Related posts about Oracle