Hi everyone,
I have a query problem;
i have 2 table. Table1 and Table2
(ip = Internet Protocol - IP Address)
Select Query working but Update query not working
Select Query:
SELECT
TABLE1.ip
FROM
TABLE1
WHERE NOT EXISTS(
SELECT
*
FROM
TABLE2
WHERE
TABLE1.ip = TABLE2.ip
)
AND TABLE1.ip_usage = 1 AND TABLE1.ip_type = 'D'
Update Query: (not working - number of rows affected 0)
UPDATE
TABLE1
SET
ip_usage = '0'
WHERE NOT
EXISTS(
SELECT
*
FROM
TABLE2
WHERE
TABLE1.ip = TABLE2.ip
) AND TABLE1.ip_usage = 1 AND TABLE1.ip_type = 'D'
Table1 = IP_POOL and Table2 Live_Using_Ip_Address
I want to clear the unused ip addresses in the table
Please help, thanks