Skip to content
Advertisement

How to filter records in sql server? [closed]

I have a table called “Status” as shown below in sql server.

enter image description here

How can I filter the records where the timestamp is less then 5 minutes for the same Level and same Status?

Eg: For the above records my output should be like

enter image description here

Advertisement

Answer

Use lag():

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement