Skip to content

Instantly share code, notes, and snippets.

@the-undefined
Created January 26, 2016 09:20
Show Gist options
  • Save the-undefined/a9866e9b3c0ce42a4acb to your computer and use it in GitHub Desktop.
Save the-undefined/a9866e9b3c0ce42a4acb to your computer and use it in GitHub Desktop.
Make a query on the year of a date column (rails / PostgreSQL)
TimeWindow.where(%{EXTRACT(YEAR FROM start_date) = ?}, 2020)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment