UPDATE tableprefixusertextfield SET vbsoccernotify=1 WHERE vbsoccerprefs IS NULL AND EXISTS (SELECT * FROM tableprefixsoccer_user_bet WHERE userid=tableprefixusertextfield.userid LIMIT 1);