I've got the next table (call it alarm_issues).
idal | idaction | dt ---- | -------- | ------------------- 5 | 6 | 2016-09-23 15:02:50 5 | 7 | 2016-09-23 16:00:00 5151 | 7 | 2016-09-01 00:00:00 5151 | 6 | 2016-12-01 15:35:34
But I need to get the next table from the last:
idal | idaction | dt ---- | -------- | ------------------- 5 | 7 | 2016-09-23 16:00:00 5151 | 6 | 2016-12-01 15:35:34
This means that I want "For each group of rows by idal value, I want only the most recent row by keeping tyhe idaction value". I've tried some things, but never works, because the idaction value it loses and mixes with the other (when you group by idaction field).