Other possibility would be to perform a self join on the table with a condition (id = id + 1, id = id + 2 ...) and get the values and do greatest out of it. This however may be more expensive as I guess compared to even WINDOW operator but you need to test with your data.
↧