On Wed, 1 Sep 2004, Alex wrote:

> contorizate dupa un anumit tipar. Spre exemplu:
> tote ip-urile de forma 172.16.15.X  sa devina 172.16.100.X
>
> Banuiesc ca e destul de simplu, insa cum sql-ul nu e punctul meu forte,
> poate ma lamureste cineva cum se poate rezolva problema.

        Cred ca ar merge ceva de genul:

UPDATE acct_clientip
SET ip=(        split_part(ip::text, '.', 1) || '.' ||
                split_part(ip::text, '.', 2) || '.' ||
                '100' || '.' ||
                split_part(ip::text, '.', 4)
        )::inet
WHERE ip::text~'172.16.15';

        Mi se pare cam din topor dar altceva mai elegant nu-mi vine 
acum.

-- 
Any views or opinions presented within this e-mail are solely those of
the author and do not necessarily represent those of any company, unless
otherwise expressly stated.

--- 
Detalii despre listele noastre de mail: http://www.lug.ro/


Raspunde prin e-mail lui