How to use greater than operator with date?

前端 未结 6 1707
鱼传尺愫
鱼传尺愫 2020-12-05 03:36

No idea what is going on here. Here is the query, right from phpMyAdmin:

SELECT * FROM `la_schedule` WHERE \'start_date\' >\'2012-11-18\';
6条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-05 04:20

    you have enlosed start_date with single quote causing it to become string, use backtick instead

    SELECT * FROM `la_schedule` WHERE `start_date` > '2012-11-18';
    
    • SQLFiddle Demo

提交回复
热议问题