MYSQL ERROR: 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CASE WHEN IFNULL(MCMarkupPercent,0) = 0 THEN AZ_ZO WH' at line 1
Çàïðîñ aka StrQuery: select dd.*,wwwwwwwwwwwwwwwwwwwwwwww CASE WHEN IFNULL(MCMarkupPercent,0) = 0 THEN AZ_ZO WHEN IFNULL(MCMarkupPercent,0) > 0 THEN AZ_ZO+AZ_ZO/100*IFNULL(MCMarkupPercent,0) END AS cost FROM ( SELECT *, NULL as hidden, FALSE as user_id, AZ_KOD as id, AZ_FLCOLOR as fl FROM ATOV WHERE id_brend=79 and AZ_FLCOLOR<4 and id_brend <> 0 AND AZ_PR_GR=0 union SELECT a.*, a.AZ_KOD as id, a.AZ_FLCOLOR as fl FROM ATOV2 a WHERE user_id='0' AND id_brend=79 and id_brend <> 0 ) dd LEFT JOIN MarginFullByClient on MCPartnerId = 0 ORDER BY AZ_ZO asc LIMIT 0,15;