Created
January 15, 2016 14:08
-
-
Save hbasria/6730e4b5a31bec6fc3b6 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| SELECT * FROM tree | |
| left join ( | |
| SELECT | |
| generate_series as id, | |
| case | |
| when generate_series = 0 then 'CREATED' | |
| when generate_series = 1 then 'PENDING' | |
| when generate_series = 2 then 'RECEIVED' | |
| when generate_series = 3 then 'STARTED' | |
| when generate_series = 4 then 'RETRY' | |
| when generate_series = 5 then 'COLLECTED' | |
| when generate_series = 6 then 'SUCCESS' | |
| when generate_series = 7 then 'FAILURE' | |
| when generate_series = 8 then 'REVOKED' | |
| when generate_series = 9 then 'IGNORED' | |
| when generate_series = 10 then 'REJECTED' | |
| end AS name | |
| FROM generate_series(0,10) | |
| ) as state_table on state_table.id = tree.state |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment