I am trying to query my postgresql db to return results where a date is in certain month and year. In other words I would like all the values for a month-year.
The
From PostreSQL 9.2 Range Types are supported. So you can write this like:
SELECT user_id FROM user_logs WHERE '[2014-02-01, 2014-03-01]'::daterange @> login_date
this should be more efficient than the string comparison