|
 13.7 Кб |
|
| Всем привет. Помогите довести до ума запрос.
SELECT a.`em_produce_name`,
a.`em_produce_price_ua`,
a.`em_produce_price_us`,
a.`em_produce_price_eu`
FROM `em_produce` a
WHERE a.`em_business_group_id` = 19099
AND a.`em_produce_access` = 'y'
AND a.`em_produce_deleted` = 'n'
ORDER BY a.`em_produce_price_ua` ASC, a.`em_produce_price_us` ASC, a.`em_produce_price_eu` ASC
|
Нужно так как я проставил на скрине цифрами. | |
|
|
|
|
|
|
|
для: TetRiska
(25.05.2011 в 12:28)
| | Попробуйте так
SELECT a.`em_produce_name`,
a.`em_produce_price_ua`,
a.`em_produce_price_us`,
a.`em_produce_price_eu`
FROM `em_produce` a
WHERE a.`em_business_group_id` = 19099
AND a.`em_produce_access` = 'y'
AND a.`em_produce_deleted` = 'n'
ORDER BY
IF(a.`em_produce_price_ua` = 0, 1, 0),
a.`em_produce_price_ua`,
IF(a.`em_produce_price_us` = 0, 1, 0),
a.`em_produce_price_us` ASC,
IF(a.`em_produce_price_eu` = 0, 1, 0),
a.`em_produce_price_eu` ASC
|
| |
|
|
|
|
|
|
|
для: cheops
(25.05.2011 в 12:40)
| | спасибо, то что нужно | |
|
|
|