Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: More than 1 filed in Select *
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.
>
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
![]() |
![]() |