I have two tables in a mysql database. macs and deviceinventory i want to updat macs table column name deviceid =1 but update those reords which not found in deviceinventory table column device id i use this query but it give error
UPDATE macs SET deviceid = 1
WHERE deviceid = (SELECT deviceid FROM macs NOT IN (
SELECT * FROM deviceinventory.`deviceid`
)) ;
try this: