I have to substitute LAG with a different function to find available rooms between two given dates. It must be cursive to find even a single day free for rooms. How can I do it in Mysql in Linux (without Windows functions LAG or LEAD)? Thank you.
Asked
Active
Viewed 30 times
0
-
https://stackoverflow.com/questions/8428641/views-select-contains-a-subquery-in-the-from-clause/42763968 refer this – Sandhya Srishti Sep 06 '21 at 07:20
-
Your local and server version of mysql are probably different. Your local supports subqueries in views, the server version does not. You always have to use exactly the same version locally as on the server. See my answer to the duplicate question around the versions: https://stackoverflow.com/a/42763968/5389997 and the rest of the answers will give you workarounds for your server version. – Shadow Sep 06 '21 at 07:24
-
Upgraded the mysql version. The problem is solved. – Ladis Sep 07 '21 at 09:47
-
This one solution works fine in Windows, since LAG and LEAD functions are of windows. But how can we substitute it in Linux? – Ladis Oct 19 '21 at 14:59