3
I’m using SQL Server 2008 R2 and I have the following table:
ID NUMERO NOME MODELO
--- ----------- ------ -------
1 12 A 777
2 23 A 777
3 05 A 777
4 45 B 999
5 65 C 555
6 30 B 999
7 67 B 999
8 80 C 555
9 51 C 555
10 03 C 555
I wish my query return to the following table:
ID NUMERO NOME MODELO
--- ----------- ------ -------
2 23 A 777
7 67 B 999
8 80 C 555
That is, I want to return the records with the highest values of the NUMERO column between the lines, regardless of how many records there are.
group by
by model, withsubselect
catching themax(numero)
... :)– David
If you’re right, you should put the visa there.
– White
Thanks, it worked out!
– Melkz Siqueira