Created
August 6, 2013 16:50
-
-
Save ailabs-software/6166301 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
presidentuncletom=# SELECT name, ARRAY(SELECT (title, id) FROM groups_map RIGHT OUTER JOIN | |
groups ON (groups_map.group_id = groups.id) WHERE groups_map.item_id=person.id) | |
AS groups FROM person; | |
name | groups | |
-----------------+---------------------------------------------------- | |
Harley Earl | {} | |
Henry Ford | {"(\"industry mogul\",1)","(\"capital mogul\",2)"} | |
Rick Wagoner | {} | |
Alfred P. Sloan | {"(\"industry mogul\",1)","(\"capital mogul\",2)"} | |
Bob Eaton | {} | |
Howard Shultz | {} | |
Warren Buffet | {} | |
Jamie Dimon | {} | |
Michael Eisner | {} | |
Charlie Munger | {} | |
Lee Iacocca | {} | |
Bob Lutz | {} | |
Fritz Henderson | {} | |
Ken Chennault | {} | |
Lew Wasserman | {"(\"industry mogul\",1)"} | |
(15 rows) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment