PostgreSQL: Select data with a like on timestamp field

后端 未结 5 1137
隐瞒了意图╮
隐瞒了意图╮ 2020-12-23 16:29

I am trying to select data from a table, using a \"like\" on date field \"date_checked\" (timestamp). But I have this error :

SQLSTATE[42883]: Undefined func         


        
5条回答
  •  遥遥无期
    2020-12-23 17:25

    I don't believe you can do a like on a date column without converting it to a string representation first.

    You can use the between query to select between two dates, for instance:

    SELECT id FROM my_table WHERE date_checker BETWEEN '2011-01-01' AND '2011-02-01';
    

提交回复
热议问题