How to use greater than operator with date?

前端 未结 6 1701
鱼传尺愫
鱼传尺愫 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:06

    In your statement, you are comparing a string called start_date with the time.
    If start_date is a column, it should either be

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

    (no apostrophe) or

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

    (with backticks).

    Hope this helps.

提交回复
热议问题