select a.`id`, CONCAT_WS('/', c.`url`, a.`url`) AS `url`, a.`date`, a.`title`, a.`announcement`, c.`name` from `cms_articles` a left join `cms_categories` c on c.`id`=a.`categoryId` where a.`language`='ru' and a.`published`='1' and a.`date`<='2019-12-06 09:58:23' and (a.`city`='' or a.`city`='TAS') and (a.`categoryId` in (185) or (a.`addCats2` like '%-185-%')) order by a.`ord` desc, a.`id` desc limit 40, 20