For each buoy that has at least one record, show the status from its latest record. If records have the same time, choose the record with the highest identifier.
Columns: buoy_id, buoy_name, status, recorded_at
Sort by buoy_id in ascending order.
PostgreSQL 17; the query is run in a browser.
Starting PostgreSQL…
Starting PostgreSQL…