Table 1 has columns (id, a, b, c, group). There are several lines that have the same group, but the identifier is always unique. I would like the group SELECT, a, b FROM Table1 WHERE, the group is different. However, I would like the returned data to be from the row with the largest identifier for this group.
So if we have lines
(id=10, a=6, b=40, c=3, group=14)
(id=5, a=21, b=45, c=31, group=230)
(id=4, a=42, b=65, c=2, group=230)
I would like to return these 2 lines:
[group=14, a=6,b=40] and
[group=230, a=21,b=45] (because id=5 > id=4)
Is there a simple SELECT statement?
source
share