現(xiàn)在商品item表結(jié)構(gòu)item_id, title, product_id, type, price一個product下有多個商品,商品item有4種type(0,1,2,3),同一個type下可以有多個同樣type與同樣product_id的商品?,F(xiàn)在有N個商品id,我要根據(jù)這些商品id,來獲取這些商品的product_id,然后根據(jù)這些product_id再獲取item表里面,所有 product_id與4個type值組合下的一個price最低的商品 的列表。應(yīng)該怎么寫sql?
請教這個sql怎么寫?
阿波羅的戰(zhàn)車
2018-07-20 11:23:25