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