MySQL Forums
Forum List  »  Italian

Uso della funzione REPLACE
Posted by: mario zanni
Date: April 16, 2020 07:17AM

Buongiorno,

avrei bisogno di trovare tutti i valori in una tabella "netmap" con campo "IP" che inziano con "192.168.%" e sotituire l'intero campo con "172.16.21.0"

Valore da cercare LIKE '%192.168.%'
Valore da sostituire 172.16.21.0

Cerca in rete e facendo varie prove sono arrivato ad un punto morto:

UPDATE netmap
SET ip = REPLACE(ip, '192.168.', '172.16.21.0')
WHERE ip LIKE ('192.168.0%');

Con questo codice trova il record 192.168.0.1 e lo traduce in 172.16.21.0.0.1

Grazie in anticipo a chi avrà tempo di suggerirmi la query corretta da eseguire.

Options: ReplyQuote


Subject
Views
Written By
Posted
Uso della funzione REPLACE
632
April 16, 2020 07:17AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.