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!
Answers
-
Hi Eldynn
This is the perfect use case for our Add-ons feature. Here's some content to check out that will help you implement this.
Categories
- All Categories
- 53 ? Announcements
- 47 ? Releases
- 37 ? Welcome
- 983 ? Help! I'm a Noob
- 125 ? No-Code Front-Ends
- 633 ? Working with APIs
- 439 ? Transforming data
- 126 ? Connect Xano to ...
- 50 ?? Find an Expert
- 348 ❓Other questions
- 35 ? Security
- 22 ✂️ Snippets
- 19 ? Showcase
- 7 ?️ Xano Chatter
- 62 ? Video Tutorials
- 171 ? Request a feature
- 229 ? Report a Bug
- 19 ? Templates & Extensions
- 7 ? Feedback