1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| select *
from products p
left join
products_description pd
on p.products_id=pd.products_id
left join
products_to_categories pc
on p.products_id = pc.products_id
left join
categories c
on c.categories_id = pc.categories_id
left join
categories_description cd
on cd.categories_id = pc.categories_id
where p.products_model REGEXP 'mv[0-9\\.]+'
or p.products_model_f REGEXP 'mv[0-9\\.]+'
and pc.categories_id in (1045, 1046, 1047, 1048, 1049
, 93105, 93106, 93107, 93108, 93109, 93110, 93111, 93112
, 93124, 93125, 93126, 93127, 93128, 93129, 93130, 93131, 93132)
and p.codeF not in (2, 11, 12, 13)
group by p.products_id
order by p.products_model
, c.parent_id asc |
Partager