Skip to content
Advertisement

d6 delta query – get the latest entry

I’m working on a query but I’m running into an issue with deltas and getting the latest info. If I have a table as such….

I’d like to get results like:

I want the latest delta that has a value per ID. I’m writing this in postgres but running into some issues. Any suggestions?

Advertisement

Answer

You can get the largest delta with a value using distinct on and filtering:

However this does not return exactly the results you have specified.

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