SELECT SQL_CALC_FOUND_ROWS * FROM(SELECT DISTINCT 1 ntype, 1 stype, n.id, n.string_id, n.short_text, '' content, '' link, n.subdomain, n.date_up, m.visitors, n.title, n.title_long, n.img_url, n.views, n.has_video, r.first_name, r.last_name, r.id as rid FROM news n INNER JOIN persons r ON r.id=n.reporter LEFT OUTER JOIN yametrika_news m ON m.news_id = n.id INNER JOIN sections_tags st ON st.sec_id=n.section1 AND st.tag_id = '1680' WHERE n.status='publish' UNION SELECT DISTINCT 2 ntype, 1 stype, n.id, n.string_id, n.short_text, '' content, '' link, n.subdomain, n.date_up, m.visitors, n.title, n.title_long, n.img_url, n.views, n.has_video, r.first_name, r.last_name, r.id as rid FROM news n INNER JOIN persons r ON r.id=n.reporter LEFT OUTER JOIN yametrika_news m ON m.news_id = n.id INNER JOIN news_tags nt ON nt.news_id=n.id AND nt.tag_id in ('1680') WHERE n.status='publish' UNION SELECT DISTINCT 3 ntype, 2 stype, n.id, n.string_id, '' short_text, n.content, n.link, n.subdomain, n.date_up, m.visitors, n.title, n.title_long, n.img_url, n.views, n.has_video, '' first_name, '' last_name, '' as rid FROM qnews n LEFT OUTER JOIN yametrika_qnews m ON m.qnews_id = n.id INNER JOIN qnews_tags nt ON nt.qnews_id=n.id AND nt.tag_id in ('1680') WHERE img_url != '' AND publish = '1' AND content != '' ) n ORDER BY n.date_up DESC LIMIT 1575,35