Oracle's SQL:
Code:
UPDATE ip_table SET
gateway = SUBSTR(ip, 1, INSTR(ip, '.', 1, 3)) || '1';
The INSTR(char1, char2 [,n[,m]]) function searches "char" beginning with its "n"th character for the "m"th occurrence of "char2" and returns the position of the character in "char" that is the first character of this occurrence.
"||" represents concatenation operator.
For example, this query would do something like that:
Code:
IP GATEWAY
------------------ ---------------
192.134.45.67 192.134.45.1