MySQL Forums
Forum List  »  Newbie

Re: Incress Number
Posted by: Raphael ottiger
Date: November 19, 2021 07:18AM

Hello and thanks for your help.

Now I know how lag works.
But my problem is, that I creat an new row with the maximum values oft he day. How can I get this new row and creat an new row with the lag values? At the moment in my new created row with the lag values are only null values.


SELECT *, max(kilometers)
LAG(MeasurementKilometers. kilometers) over(PARTITION by Id Order by readDate) AS test
From `MeasurementKilometers`
where Id = 1
GROUP by ReadDate

Options: ReplyQuote


Subject
Written By
Posted
November 18, 2021 08:43AM
November 18, 2021 09:17AM
Re: Incress Number
November 19, 2021 07:18AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.