SELECT
user_id,
unix_timestamp,
LAG(unix_timestamp,1) OVER (PARTITION BY user_id ORDER BY unix_timestamp)
As Previous_time
FROM mydb.query_one
LIMIT 5;
Error Code: 1064. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(PARTITION BY user_id ORDER BY unix_timestamp) AS previous_time, RO' at line 5
0.056 sec