I have the folowing sql query:
SELECT DISTINCT(tbl_products.product_id), tbl_products.product_title,
tbl_brands.brand_name, tbl_reviews.review_date_added,
NOW() AS time_now
FROM tbl_products, tbl_reviews, tbl_brands
WHERE tbl_products.product_id = tbl_reviews.product_id AND
tbl_products.brand_id = tbl_brands.brand_id
ORDER BY tbl_reviews.review_date_added DESC
That needs to filter out any duplicate product_id s unfortunatly selecting tbl_reviews.review_date_added makes each record unique which means DISTINCT will not work anymore.
是否有其他途径来做这种问询,使产品_id仍然独一无二?
我是按组别做的,问题在于我在网站上显示“审查——日期”,并选择最老的日期。 我需要最新的日期。
关于