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: 1 Sep 2006 02:58:18 -0700
Message-ID: <1157104698.537088.100890@b28g2000cwb.googlegroups.com>

steph schreef:

> 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;

Yes - but that's another query!
"give me some column and then all of t - which is a synonym for MYTEST, btw"
Not the same as
"give me all and then some " Received on Fri Sep 01 2006 - 04:58:18 CDT

Original text of this message

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