Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • 1
    If CosmosDB doesn't have window functions, then you want greatest-n-per-group - if user_name is a PK, then you should be able to SELECT c.user_name, MAX(c.date_time) AS mdt FROM checkup_data c GROUP BY c.user_name and then join that back to checkup_data on the PK and mdt - taking the bp and temp... I did something like this today here - there's links within also. Commented Apr 8, 2021 at 19:42
  • 1
    I threw together this - if no window functions are available... Commented Apr 8, 2021 at 20:09
  • 1
    Thanks Verace. I think JOIN ON is different for Azure Cosmos. This example only has JOIN IN. I will try to adapt your code. Commented Apr 9, 2021 at 15:27