You can translate the question and the replies:

How to select the records with the most recently updated status from duplicate records?

In the sample table below, I'd like my query to return only the rows for the records where ThingA has the status of C as updated on 15December2022 (most recent update) and ThingB as the status of B as updated on 21November2022 (most recent update). I want to be able to return all the columns in the table as well so I can't really sort and group by? | Entity | Status | DateUpdated | | -------- | -------- | -------- | | ThingA | A | 02122022 | | ThingA | B | 10122022 | | ThingA | C | 15122022 | |ThingB|A|01112022| |ThingB|B|21112022|
21-12-2022 09:16:52 -0500

1 Answer

Hi, To find the most recent update, I would use the **MAX()** function and then create a condition to find the specific values of the entity and status. For example in your scenario I would put: *Where entity like 'ThingA' and status like 'C' or entity like 'ThingB' and Status like 'B' * Finally I would group by the entity and the status. You can refer to [MAX]( and [Comparison Operators]( in the **Virtual DataPort VQL Guide** for more information. If you still need help and you have a valid support user account, please open a new support case at the [Denodo Support]( site so that the support team can assist you. Hope this helps!
Denodo Team
21-12-2022 21:07:54 -0500
You must sign in to add an answer. If you do not have an account, you can register here