Last active
October 3, 2019 13:37
-
-
Save chocobn69/5a56fc3f7c90f4b1ad1dad1197e29097 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
create table town(id, label); | |
create table road(id, start_town_id, end_town_id); | |
create table travel(id, road_id); | |
-- I want all town, both start and end | |
select | |
unnest(array[start_town_id, end_town_id]) | |
from travel | |
inner join road on road_id = road.id |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment