I have BigQuery table that store the record of equipment position like this:
and I want to get the latest record before the given time and make the table this:
where the first and the second record combined in the same row.
I usually use PostgreSQL and would do this with LEFT JOIN LATERAL but LATERAL JOIN is not available in BigQuery and I'm having hard time to do this in standard SQL. And I think this can be solved with OVER PARTITION but i'm not sure
Anyone knows to solve it? Thanks!