I have a list of players in a tournament.
tournament=> SELECT * FROM players;
name | player_id
-------------------+-----------
Twilight Sparkle | 9
Fluttershy | 10
Applejack | 11
Pinkie Pie | 12
Rarity | 13
Rainbow Dash | 14
Princess Celestia | 15
Princess Luna | 16
(8 rows)
This is how I would like the list to look. How do I ask postgreSQL to make it so?
name1 | id1 | name2 | id2
-------------------+---------+-------------------+-------
Twilight Sparkle | 9 | Fluttershy | 10
Applejack | 11 | Pinkie Pie | 12
Rarity | 13 | Rainbow Dash | 14
Princess Celestia | 15 | Princess Luna | 16
(4 pairs)