write a code in R/SQL: Given a table with three column, (id, category, value) and each id has 3 or less category (price, size, color). Now, how can I find those id's for which the value of two or more category matches to one another? For eg: ID1 (price 10, size M, color Red), ID2 (price 10, Size L, Color Red) , ID3 (price 15, size L, color Red) Then the output should be two rows: ID1 ID2 and ID2 ID3
Sigiloso
select category, category_value, count(1) as matching_categories, group_concat(id) from b_product group by category, category_value having matching_categories>=2