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: steph <stephan0h_at_yahoo.de>
Date: 31 Aug 2006 06:08:04 -0700
Message-ID: <1157029684.615491.151910@h48g2000cwc.googlegroups.com>


frank.van.bortel_at_gmail.com wrote:
> 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.

you can:

Select 0 as MYVALUE, t.* FROM MYTEST t; Received on Thu Aug 31 2006 - 08:08:04 CDT

Original text of this message

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