Could you help me with a query I'm trying to do please? The idea is to select the latest created_date from each val1, val2 unique combination.
https://www.db-fiddle.com/f/fHc6MafduyibJdkLHe9cva/0
Expected result:
val1 | val2 | num1 | num2 | created_date |
---|---|---|---|---|
X | A | 33 | 333 | 2022-11-03 |
X | B | 66 | 666 | 2022-11-06 |
X | C | 88 | 888 | 2022-11-08 |
X | D | 99 | 999 | 2022-11-09 |
Y | A | 111 | 1111 | 2022-11-11 |
To the moderators. My question is different from the one below because I'm using 2 tables instead of just one, and that's the complex part for me. Please see fiddle link for more details. Get records with max value for each group of grouped SQL results