Skip to content

Instantly share code, notes, and snippets.

@m4nu56
Created October 9, 2020 15:39
Show Gist options
  • Save m4nu56/9fdb3dbcbb95d7130d89737f5b34f96a to your computer and use it in GitHub Desktop.
Save m4nu56/9fdb3dbcbb95d7130d89737f5b34f96a to your computer and use it in GitHub Desktop.
UPDATE journey_patterns p SET name = (
SELECT l.name
FROM journey_patterns jp
JOIN routes r ON jp.route_id = r.id
JOIN lines l ON r.line_id = l.id
WHERE l.name IS NOT NULL
AND l.name <> ''
AND jp.id = p.id
) || ' - ' || name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment