I am currently using the following query to get all the inspections done on june 2010:
select inspections.name
from inspections
where
to_char(inspections.insp_date, 'YYYY') = 2010 and
to_char(inspections.insp_date, 'MM') = 06;
but this feels kinda awkward. Wouldn't there be a better way of doing this? Looking at http://infolab.stanford.edu/~ullman/fcdb/oracle/or-time.html it doesn't seem so. I am using Oracle, if it makes a difference.
Thanks