Quote:
Originally posted by Bassam72
Hello Guys,
I am trying to write an SQL statment for MySQL database as I used to write in ORACLE database, but the problem is that I am getting an Error whenver I Lunch the statment. So anyone can help me in this matter??
The SQL statment is:
UPDATE Gatewys SET Gateway_IP = '192.168.1.2' WHERE Aliase_No = (SELECT Aliase_No FROM Gateways WHERE Gateway_IP = '0.0.0.0' ORDER BY Aliase_No LIMIT 0, 1);
The error I am getting is:
ERROR 1064: You have an error in your SQL syntax near 'SELECT Aliase_No FROM Gateways WHERE Gateway_IP = '0.0.0.0' ORDER BY Aliase_No L' at line 1
Thanks for help
Bassam72
|
MySql does not support nested queries other than in INSERT ... SELECT and REPLACE ... SELECT
This will update the first found entry having 0-IP
UPDATE Gateways Set Gateway_IP = '192.168.1.2' WHERE Gateway_IP = '0.0.0.0' LIMIT 1
Good luck
/pekron