I have the following MySQL Query:
SELECT concat_ws('/', exp_month, exp_year) as exp_date
FROM `cc_info`
WHERE concat_ws('/', exp_month, exp_year) <= '05/12'
The query is pulling back results in the future as well as in the past. Any idea what I am doing wrong here?
You are comparing strings in lexicographical order, and the month comes before the year. If you put the year before the month, then they will be in the correct order: