我要在一个查询中检索表“库存”中以行形式存储在表“价格”中的商品的三个定价级别(批发,分销商,零售)
Inventory:
stockID | description
-----------------------
id1 | Name 1
id2 | Name 2
id3 | name 3
prices:
stockID | price_level | value
------------------------------
id1 | W | 6.20
id1 | R | 12.40
id1 | D | 5.40
id2 | W | 8.50
id2 | R | 17.00
id2 | D | 7.40
id3 | W | 14.80
id3 | R | 28.00
id3 | D | 12.40
What I'm aiming at:
stockID | description | priceW | priceR | PriceD
id1 | Name 1 | 6.20 | 12.40 | 5.40
id2 | Name 2 | 8.50 | 17.00 | 7.40
id3 | name 3 | 14.80 | 28.00 | 12.40
谢谢!