few days before I asked similar question.
I have got a table containing material types:
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
with SQL I want to create list as follows:
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
Is that possible with pivot?