1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| select table_produits.prd_id, table_produits.reference, table_produits.prix_promo, table_produits.prix_ttc, table_prd_categories.cat_code,
table_produits.nouveauter, table_produits.destockage, table_produits.ref_couleur, table_produits.sortie_de_collection, table_produits.top_vente,
table_produits.coup_coeur, table_produits.vente_flash
from table_produits
right join table_prd_description on table_produits.prd_id = table_prd_description.prd_id
right join table_prd_categories on table_produits.prd_id = table_prd_categories.prd_id
right join table_categories on table_prd_categories.cat_code = table_categories.code
where actif=1
and prd_id IN (6618,6973,6974,296,317,323,328,331,335,337,364,365,377,379,383,384,386,387,388,390,392,6969,6998,906,907,909,910,915,1564,1624,1626,1629,6975,2314,2315,2319,2321,2322,2413,2416,2435,2531,2535,2547,2643,2681,2720,2722,2732,2735,2858,2859,2860,2959,2964,2966,6980,6510,6507,6506,6505,6502,6994,6983,6984,5907,5937,5938,5939,5940,5941,6978,6224,6415,6416,6620,6623,6659,6660,6661,6662,6663,6664,6665,6668,6672,6673,6982,6908,6909,6981,7144,7145,7146,7147,7188,7189,7190,7191,7195,7258,7259,7260,7315,7355,7436,7438,7490,7497,7540,7544,7545,7546,7547,7548,7557,7558,7559,7560,7582,7583,7584,7585,7598,7607,7608,7609,7610,7621,7632,7633,7634,7635,7644,7645,7646,7657,7658,7659,7675,7898,8235,8236,8237,8238,8239,8240,8241)
and cat_code REGEXP '^[0-9]{2}20'
and cat_code REGEXP '^[0-9]{4}10'
and cat_code REGEXP '^10|^30|^20'
and EXISTS (SELECT * FROM table_prd_infos WHERE champs_options_id IN (147,231) AND prd_id = table_produits.prd_id)
and EXISTS (SELECT * FROM table_prd_infos WHERE champs_options_id IN (197) AND prd_id = table_produits.prd_id)
and NOT EXISTS (SELECT * FROM table_prd_infos WHERE champs_options_id IN (308,309,310,311) AND prd_id = table_produits.prd_id)
and NOT EXISTS (SELECT * FROM table_prd_infos WHERE champs_options_id IN (17) AND prd_id = table_produits.prd_id)
and sortie_de_collection != 1
and cat_code not like '00%'
and prix_promo BETWEEN 0 and 1500
GROUP BY reference
order by ventes DESC ,reference
LIMIT 0,12 |
Partager