I have, for example, this table:
id | name | campagna | valore |
---|---|---|---|
1 | u1 | 1 | 22 |
2 | u1 | 2 | 23 |
4 | u2 | 1 | 223 |
5 | u3 | 2 | 223 |
I would select rows that have name value unique(distinct) but the row that has max(campagna) between the rows with same name . For example I would have :
name | campagna | valore |
---|---|---|
u1 | 2 | 23 |
u2 | 1 | 223 |
u3 | 2 | 223 |
Can I do it? Thanks.