I've got a list like this where I need to get the max date per year for each combination of unique IDs.
Calculated-Date|ID_A | ID_B | ID_C
2017/11/5 | AB | A | C
2017/10/5 | AB | A | C
2016/10/5 | AB | A | C
2017/10/5 | AB | C | C
2016/10/5 | AB | C | C
2016/10/30 | AB | C | C
2015/10/5 | AB | C | C
What I would like to get is this
Calculated-Date|ID_A | ID_B | ID_C
2017/11/5 | AB | A | C
2016/10/5 | AB | A | C
2017/10/5 | AB | C | C
2016/10/30 | AB | C | C
2015/10/5 | AB | C | C
I've tried a variation of subqueries but I am fairly new to SQL and is truly stuck at the moment. Any help is much appreciated!
I've tried this:
select distinct max(Calculated-Date), ID_A, ID_B, ID_C
from TABLE_1
group by Calculated-Date, ID_A, ID_B, ID_C
order by ID_A, ID_B, ID_C