From Now() to Current_timestamp in Postgresql

后端 未结 5 1507
既然无缘
既然无缘 2021-01-30 19:31

In mysql I am able to do this:

SELECT *
FROM table
WHERE auth_user.lastactivity > NOW() - 100

now in postgresql I am using this query:

5条回答
  •  情话喂你
    2021-01-30 20:18

    Use an interval instead of an integer:

    SELECT *
    FROM table
    WHERE auth_user.lastactivity > CURRENT_TIMESTAMP - INTERVAL '100 days'
    

提交回复
热议问题