SELECT news.id as idd, date_id, title_id, img_id, text_id, dop_id, `view` as view, good, id_new, count(id_new) as ask FROM `news` LEFT OUTER JOIN `view` ON `news`.`id` = `view`.`id` LEFT outer JOIN `news_ask` on `news`.`id`=`news_ask`.`id_new` where `razdel`is Null group by `news`.`id` order by date_id DESC