Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: is number
In article <8pq049$dn8$1_at_goliat.eik.bme.hu>,
Horvath Andras <raas_at_balu.sch.bme.hu> wrote:
> eastking_at_my-deja.com wrote:
> > I'd like to insert a row whose id is max(to_number(id))+1 into this
> > table . In this case , the id should be 3. But to_number('ab') will
> > cause a error.How can I achieve it by only a SQL command.
>
> select max(to_number(id)) from table where id>'0' and id<'99';
>
> will work well, provided that the field id is 2 characters long at
max.
>
> raas
> --
> "With enough free time, effort, and an input string that looks like
the
> winning entry in last year's obfuscated-C contest, you can turn
> someone's simple mistake into a nationally syndicated news story."
>
I'm afraid it can not work well. Try following
select 'yes' from dual where '1a' > '0' and '1a' < '99'
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Thu Sep 14 2000 - 21:43:04 CDT
![]() |
![]() |