Created
January 27, 2015 11:53
-
-
Save campanalbero/05ddafc83aae000b1268 to your computer and use it in GitHub Desktop.
sequel で where
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
DB = Sequel.sqlite('photo/photo.db') | |
photo = DB[:photo].all | |
for year in 2000..Date.today.year do | |
puts " -- " + year.to_s + " -- " | |
start = year.to_s + '-01-01' | |
end = (year + 1).to_s + '-01-01' | |
photo = DB[:photo].where('date_time >= ? and date_time < ?', start, end).all | |
puts photo | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment