SELECT id,marque,site,isable,ise,ghost,url,nom,alt,couleur couleur,essentiel txt,prix,promo,prixo,CASE WHEN isable!=0 THEN photo WHEN wi1!=2 AND photo1_2!="" THEN photo1_2 WHEN wi1!=4 AND photo1_4!="" THEN photo1_4 ELSE photo END photo,CASE WHEN isable!=0 THEN photo2 WHEN wi1!=2 AND photo1_2!="" AND photo1_2=photo2 THEN photo ELSE (CASE WHEN wi2=2 AND photo2_2!="" THEN photo2_2 ELSE photo2 END ) END photo2,photo1_2, produit,num FROM produit_couleur WHERE prix!="0.00" AND affich=1 AND photo2!="" AND volume!=4 AND produit IN(0,8890,6362,9419,6415,6877,9344,8877,8855,9411,9342,8143,9479,9130,9477,8666,9421,9117,7484,8849,9364,5307,7488,9334,9205,8718,9116,6155,8297,8775,7965,5991,8249,6035,8927,8013,8144,9094,8405,7533,8652,9113,7234,7964,7569,8329,7235,3094,7983,7161,7550,7628,5645,7850,8506,7352,6509,7520,6501,6396,8279,1569,2363,6352,7651,6682,8071,7537,7056,8328,6417,8404,8025,7595,7860,7665,7859,7534,8331,7682,8623,8403,8797,6708) AND ( site!=3 OR ise=0 OR num<7 ) AND produit NOT IN( ) AND ( promo!='0' OR prixo!='0') ORDER BY ( (CASE WHEN site IN (1,3,4) THEN 10 ELSE 0 END) +1000-num+promo + (CASE WHEN prixo=0 THEN 0 ELSE ((prixo-prix)/prixo*50 ) END ) ) DESC,produit DESC,numErr153a