I am migration mysql to Postgres
Runing this bellow query on both Mysql and Postgres
SELECT
cb_sessions.*,cb_users.username,
cb_users.userid,cb_users.email
FROM cb_sessions
LEFT JOIN (cb_users) ON (cb_sessions.session_user=cb_users.userid)
WHERE
TIMESTAMPDIFF(MINUTE,cb_sessions.last_active,'2018-06-21 18:55:14') < 6
Get Successfully results from Mysql but in Postgres through error:
ERROR: column "minute" does not exist LINE 1: ...session_user=cb_users.userid) WHERE TIMESTAMPDIFF(MINUTE,cb_...
why getting an error in postgres and is the solution.
Basically, the issue with TIMESTAMPDIFF I think so.
WHERE cb_sessions.last_active < '2018-06-21 18:55:14' + INTERVAL 6 MINUTE
has a better change of being optimized.