GROUP or DISTINCT after JOIN returns duplicates
问题 I have two tables, products and meta . They are in relation 1:N where each product row has at least one meta row via foreign key. (viz. SQLfiddle: http://sqlfiddle.com/#!15/c8f34/1) I need to join these two tables but i need to filter only unique products. When I try this query, everything is ok (4 rows returned): SELECT DISTINCT(product_id) FROM meta JOIN products ON products.id = meta.product_id but when I try to select all columns the DISTINCT rule no longer applies to results, as 8 rows