Hi help me with the below query: My current data table are as follow.
flight_id | route |
---|---|
1 | BAHRAIN |
2 | VIENNA |
2 | DUBAI |
3 | DUBAI |
3 | COCHIN |
3 | DOHA |
3 | COLOMBO |
4 | LONDON |
4 | MOSCOW |
4 | CHENNAI |
4 | DELHI |
4 | VNUKOVO |
4 | DUBAI |
I want transpose my data table into below format. I think it is something like Pivot, but can't figure out how to do it. :)
flight_id | route1 | route2 | route3 | route4 | route5 | route6 |
---|---|---|---|---|---|---|
1 | BAHRAIN | N/A | N/A | N/A | N/A | N/A |
2 | VIENNA | DUBAI | N/A | N/A | N/A | N/A |
3 | DUBAI | COCHIN | DOHA | COLOMBO | N/A | N/A |
4 | LONDON | MOSCOW | CHENNAI | DELHI | VNUKOVO | DUBAI |
Please help me!
Thank!