In my DB I have the date field of type date (YYYY-mm-dd). What happens is that I want to fetch all records for a given year and month. For example, I want to go fetch all the records for 2014 from month 08. How can I do this? I tried something like this:
SELECT * FROM tbl_ocorrencias WHERE 'data' = '2014-08-d'