Narazili jste na zprasený kód? Nahrajte ho sem.
SELECT `table`.`id`, `table`.`name`, if(LENGTH(`table`.`subj`)>0,NULL,NULL) ...