Last active
February 16, 2018 07:57
-
-
Save dboyd13/67540ed5df340221c38e5c4929921e7d 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
# Purpose: | |
# SELECT: All DRINKS of a specific Keg | |
# OUTPUT: Drink ID, Day of Week, Date and time (localtime), | |
# SORTED BY: Volume_ml | |
select id, substr('SunMonTueWedThuFriSat', 1 + 3*strftime('%w', datetime(time, "localtime")), 3), datetime(time, "localtime"), volume_ml from core_drink where keg_id=61 ORDER BY volume_ml; | |
# Purpose: | |
# SELECT: All DRINKS of a specific Keg ONLY if weekday (Mon-Fri) | |
# OUTPUT: Drink ID, Day of Week, Date and time (localtime) | |
select id, substr('SunMonTueWedThuFriSat', 1 + 3*strftime('%w', datetime(time, "localtime")), 3) as dow, datetime(time, "localtime"), volume_ml from core_drink where keg_id=61 AND (dow = "Mon" or dow = "Tue" or dow = "Wed" or dow = "Thu" or dow = "Fri"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment