Error performing query: SELECT DISTINCT categories.id, name FROM categories_objects LEFT JOIN categories ON category_id = categories.id WHERE main_category_id = 22 ORDER BY name like 'More%', name