DELETE `subscribethread` FROM `subscribethread` LEFT JOIN `user` ON `subscribethread`.`userid` = `user`.`userid` WHERE `subscribethread`.`emailupdate` <> '0' AND `user`.`usergroupid` = 'X'