now goods item
Table structure
item_id, title, product_id, type, price
there are multiple commodities under one product, and there are 4 kinds of type for merchandise item. There can be multiple commodities with the same type and the same product_id under the same type.
now there are N merchandise id,. I want to get the product_id, of these goods according to the id, of these goods, and then get the list of items with the lowest price under the combination of all product_id and four type values in the item table according to these product_id.
how to write sql?