I have a table named 'ward_councillors' and two columns 'ward' and 'councillor'. This table contains a list of all of the councillors and the ward they are responsible for. Each ward has three councillors and what i'd need to do is group by so that I have one distinct record for each ward and three new columns with the three councillors responsible for that ward in each.
For example currently have:
WARD | COUNCILLOR ward a | cllr 1 ward a | cllr 2 ward a | cllr 23 ward b | cllr 4 ward b | cllr 5 ward b | cllr 8
trying to achieve:
WARD | COUNCILLOR 1| COUNCILLOR 2| COUNCILLOR 3 ward a | cllr 1 | cllr 2 | cllr 23 ward b | cllr 4 | cllr 5 | cllr 8
Thanks in advance, Chris