Try something like this:
SELECT * FROM ( SELECT *, ROW_NUMBER() OVER ( PARTITION BY <id_column> ORDER BY <timestamp column> DESC) row_number, FROM <table> ) WHERE row_number = 1
Note that it will add a row_number column, which you might not need. To fix this, you can select individual columns by name in an external select statement.
In your case, this is similar to the requested_at column that you want to use in ORDER BY .
And you also want to use allow_large_results, set the destination table and not specify smoothing of the results (if you have a schema with repeating fields).
Jordan tigani
source share