I have a database like this
ID | booking_id | branch_id | service_id | staff_id | rating
1 | 21 | 2 | null | null | 5
2 | 21 | null | 5 | null | 3
3 | 21 | null | null | 7 | 5
4 | 22 | 3 | null | null | 4
5 | 22 | null | 8 | null | 2
6 | 22 | null | null | 10 | 1
Is there a way where i can extract merge the data with the same booking_id and the result will be like this
booking_id |branch name |service name| staff name |branch rating|service rating|staff rating
21 |LA branch | massage | John | 5 | 3 | 5
22 |Vegas Branch | therapy | May | 4 | 2 | 1