select SQL_CALC_FOUND_ROWS
cats.*, (select COUNT(*) from `news` cats2 where cats2.pid = cats.id) as __childs
from `news` cats
where
0=0 and `archive` = '0' and (select COUNT(id) from `news` cats2 where `pid` = `cats`.id limit 1) = 0
order by cats.`sort` desc, cats.`date_create` desc Новостей нет