I have a table:
id cod_pr Date nr
-------------------------------
1 22 12.10.2012 2
2 25 12.10.2012 3
3 22 12.11.2012 5
4 25 12.11.2012 2
5 22 12.12.2012 4
6 23 12.10.2012 3
How kan I select only max Date from each cod_pr?
If you want all columns, you can use
ROW_NUMBERin a CTE:Otherwise you can simply use
GROUP BY