CODE (SQL):
скопировать код в буфер обмена
скопировать код в буфер обмена
- SELECT
- table_product.*,
- table_photo_product.photo_product4,
- table_product_brend.name AS name_brend
- FROM table_product
- LEFT JOIN table_product AS temp ON table_product.id=temp.parent
- LEFT JOIN table_photo_product ON table_photo_product.id_articul=table_product.id
- LEFT JOIN table_product_brend ON table_product_brend.id=table_product.brend
- WHERE
- temp.category_id IN (1,2,3)
- AND
- temp.visible=1
- AND
- table_product.new=0
- AND
- table_photo_product.nomber=1
- AND
- table_photo_product.id_color=table_product.color
- GROUP BY table_product.id
- ORDER BY table_product.date DESC