1
前几天我问过类似的问题。Oracle的sql pivot类型按
我有含材料类型的表:
id type mat_number description count
------------------------------------------------
a mat_1 123456 wood type a 5
a mat_2 333333 plastic type a 8
b mat_1 654321 wood type b 7
c mat_2 444444 plastic type c 11
d mat_1 121212 wood type z 8
d mat_2 444444 plastic type c 2
d mat_2 555555 plastic type d 3
与SQL我想创建列表如下:
id mat_1 description count mat_2 description count
-------------------------------------------------------------------
a 123456 wood type a 5 333333 plastic type c 8
b 654321 wood type b 7 null
c null 444444 plastic type c 11
d 121212 plastic type c 8 444444 plastic type c 2
d null 555555 plastic type c 3
那是可能的支点?
虽然不是一个完整的答案,http://stackoverflow.com/questions/32828265/rows-to-column-in-oracle#32828478与代码类似的问题,可能是能够帮助 –
在哪里问题?你试过什么了? – lad2025