Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: More than 1 filed in Select *

Re: More than 1 filed in Select *

From: <frank.van.bortel_at_gmail.com>
Date: 31 Aug 2006 05:56:47 -0700
Message-ID: <1157029007.028414.22280@m73g2000cwd.googlegroups.com>

Pietro schreef:

> Hi all,
>
> I am not able to complete the following problem, please help me.
>
> Using the following table:
>
> CREATE TABLE MYTEST
> (
> COL1 NVARCHAR2(1),
> COL2 NVARCHAR2(1)
> );
>
> I can write: Select * from MYTEST;. (Obvious !!)
>
> But I can't write: Select 0 as MYVALUE, * FROM MYTEST;
>
> Error is: ORA-00936: missing expression
>
> Why ?? Someone can help me ?
>
> Many thanks in advance
> Pietro

You can either select all (pseudo column *), or selected columns (myvalue, col1, col2)
from your table, not all plus some more... So, your query must be:
select 0 as myvalue, col1, col2 from mytest;

Besides, using * is a bad programming habit - always use the column names. Received on Thu Aug 31 2006 - 07:56:47 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US