Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: select constant.field
"Arto Viitanen" <arto.viitanen_at_csc.fi> wrote in message
news:43d60342$0$10073$ba624cd0_at_newsread.funet.fi...
> Why can I make following query
>
> select 1.foobar from dual
>
> Result is 1.0 (Oracle 10g1 EE, 32 bit Linux)
>
> So why can I use number as a table name (or actually table alias) and
> why that "table" can have what ever field?
>
> When I tried
>
> select 1."foo bar" from dual
>
> I get 1 as result.
>
> --
> Arto Viitanen, CSC Ltd
> Espoo, Finland
so your query is the equivalent of
select 1. xxxx
from dual
which is the equivalent of
select 1. as xxxx
from dual
bottom line '1.' is a numeric expression -- the text (quoted or not) after the decimal is being interpreted as a column alias (which you'll notice if you take a close look at you output in SQL*Plus)
i.e.
SQL> select 1xxx from dual;
XXX
1
++ mcs Received on Tue Jan 24 2006 - 05:09:48 CST
![]() |
![]() |