Unknown column 'attr_val.name_ru-RU' in 'order clause' SQL=SELECT prod.product_id, pr_cat.category_id, prod.`name_ru-RU` as name, prod.`short_description_ru-RU` as short_description, prod.product_ean, prod.image, prod.product_price, prod.currency_id, prod.product_tax_id as tax_id, prod.product_old_price, prod.product_weight, prod.average_rating, prod.reviews_count, prod.hits, prod.weight_volume_units, prod.basic_price_unit_id, prod.label_id, prod.product_manufacturer_id, prod.min_price, prod.product_quantity, prod.different_prices, prod.`carttitle_ru-RU` , prod.unlimited FROM `coins_jshopping_products` AS prod LEFT JOIN `coins_jshopping_products_to_categories` AS pr_cat USING (product_id) WHERE pr_cat.category_id = '126' AND prod.product_publish = '1' AND prod.access IN (1,1,5) ORDER BY if (LENGTH(trim(attr_val.`name_ru-RU`))>4,STR_TO_DATE(monthNameToNumber(trim(attr_val.`name_ru-RU`)),'%d.%m.%Y'),STR_TO_DATE(trim(attr_val.`name_ru-RU`),'%Y')) ASC LIMIT 0, 1000