I need a query that will 'Select' 6 columns named MN, S1, S2, S3, S4, S5 where the value in MN is derived from column A's value where column B's value is -1 and the value in columns S1-S5 are derived from column A's value where column B's value is the value of MN. Every row should have the 7 columns. Those that do not produce a value should be 'NULL'. You can assume the order in the table is exactly as the order of the columns in the output.
This is an example of a table
A B
10 -1
50 10
51 10
52 10
11 -1
60 11
61 11
62 11
63 11
12 -1
70 12
71 12
72 12
73 12
74 12
This is how the output should look
MN S1 S2 S3 S4 S5
10 50 51 52
11 60 61 62 63
12 70 71 72 73 74