Is it possible to get the most recent record for each group?
Hi everyone!
I have a table candidate link to tables order and worker. Each line in this table candidate have different status like:
I want to make a query all request filtered by "where order_id = input.order_id" to fetch only the candidates of a specific order. But I want to only have one record per worker_id so I can get the latest status of each worker that are candidate on a specific order.
Example with where order_id = 2
[
{ id: 3, status: "status 1", worker_id: 1 },
{ id: 2, status: "status 2", worker_id: 2 }
]
I can get that by using the query all with a group by and an aggregate like this:
My issue is that I want to get details of the candidate like his status which I will not get with this request cause it's not part of the aggregation.
Have a nice day!
Categories
- All Categories
- 46 π£ Announcements
- 47 π¦Ύ Releases
- 36 π Welcome
- 924 π€· Help! I'm a Noob
- 113 π± No-Code Front-Ends
- 597 π Working with APIs
- 418 π’ Transforming data
- 120 π Connect Xano to ...
- 46 π§βπ» Find an Expert
- 320 βOther questions
- 32 π Security
- 22 βοΈ Snippets
- 19 π Showcase
- 7 π£οΈ ο»Ώ Xano Chatter
- 60 πΊ Video Tutorials
- 166 π Request a feature
- 219 π Report a Bug
- 19 π Templates & Extensions
- 6 π¬ Feedback