Re: String manipulation

From: Michel Cadot <micadot_at_netcourrier.com>
Date: Thu, 6 Sep 2001 09:57:17 +0200
Message-ID: <9n7a8u$3iq$1_at_s1.read.news.oleane.net>


[Quoted] "Vigi98" <vigi98_at_my-deja.com> a écrit dans le message news: Yxtl7.3479$lf2.3949710_at_nnrp5.proxad.net...
> Hi all,
>
> Does anybody know if there are basic string manipulation procedures in
> PL/SQL ? My problem is quite simple : I have several strings like totoN
> where toto is always the same string and N a number which changes (eg :
> azerty1, azerty23, azerty4,...)
>
> I want to extract the N max of all these strings.
>
> Any idea ?
>
> Thanks in advance.
>

v815> create table t (col varchar2(20));

Table created.

v815> select * from t order by col;

COL



toto1
toto2
toto23
toto3

4 rows selected.

v815> select max(translate(col,' abcdefghijklmnopqrstuvwxyz',' ')) from t;

MAX(TRANSLATE(COL,'A



3

1 row selected.

[Quoted] v815> select max(to_number(translate(col,' abcdefghijklmnopqrstuvwxyz',' '))) from t;

MAX(TO_NUMBER(TRANSLATE(COL,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','')))


                                                            23

1 row selected.

--
Hope this helps
Michel
Received on Thu Sep 06 2001 - 09:57:17 CEST

Original text of this message