Some of the sql queries I used at some point :)
Files in this gist
- SQLHeaderCommentFormat: Format for the header of the queries
- SelectRowWhenOtherRowDontExist.sql: Select the row that fulfill the condition, if that row does not exist or there is no row fulfilling that condition, chose another one