jaimex8
12/9/2015 - 10:59 PM

Select tables and combine

Select tables and combine

<!--MySQL Select 5 different Tables, Cross Reference, Combine-->
SELECT
    s01_Products.code,
    s01_Products.name,
    s01_Products.descrip,
    s01_SS_REVIEWS_reviews.review,
    s01_SS_REVIEWS_reviews.rating,
    s01_SS_REVIEWS_reviews.title,
    s01_SS_REVIEWS_reviews.name,
    s01_SS_REVIEWS_reviews.email,
    s01_SS_REVIEWS_reviews.product_id,
    s01_SS_REVIEWS_reviews.dyn_time,
    s01_CFM_ProdValues.value,
    s01_Images.image
FROM s01_SS_REVIEWS_reviews
INNER JOIN s01_Products
ON s01_Products.id = s01_SS_REVIEWS_reviews.product_id
INNER JOIN s01_CFM_ProdValues
ON s01_CFM_ProdValues.product_id = s01_SS_REVIEWS_reviews.product_id
INNER JOIN s01_ProductImages 
ON s01_ProductImages.product_id = s01_SS_REVIEWS_reviews.product_id
INNER JOIN s01_Images
ON s01_Images.id = s01_ProductImages.image_id
WHERE s01_CFM_ProdValues.field_id = 84 AND s01_ProductImages.type_id = 1