A set of data is uploaded by my colleague and I have to filter the data by date. Unfortunately my colleague used reserved words of year and month for uploading the data so the data in database looks like this:
babyname year month gender
----------- ---- ----- ------
Sarah 2018 2 f
Jack 2016 5 m
James 2017 7 m
Susan 2017 1 f
I am going to filter baby girls name who were born from or after April 2017. I wrote following query but it does not filter the data by date at all:
SELECT * FROM babytable
WHERE
gender='f'
AND
(("year"=2017 AND "month">3) OR "year"=2018);
Would you please let me know what is my mistake. Many Thanks
where gender = 'f' and ("year", "month") >= (2017,4).