SELECT `g`.`id`, `g`.`parent_id`, `g`.`original_id`, `g`.`dir`, `g`.`way`, `g`.`title`, `g`.`title_long`, `g`.`type` FROM `market_articles` `a` INNER JOIN `market_items` `i` ON `i`.`id` = `a`.`id` INNER JOIN `market_groups` `g` ON `g`.`id` = `a`.`group_id` WHERE `i`.`hidden` = 0 AND `i`.`deleted` = 0 AND ((`l`.`type` = "tourist" AND `l`.`mark_id` = 0) OR (`l`.`mark_id` = "0" AND `l`.`type` = "tourist")) GROUP BY `a`.`group_id` ORDER BY `g`.`order` ASC, `g`.`title` ASCUnknown column 'l.type' in 'where clause'