0

Hi there I have this in mysql.

record rate update
   1      1      1
   2      1      2
   3      1      3
   4      1      4
   5      2      1
   6      2      2
   7      3      1
   8      3      2
   9      3      3

I want to select the rows with the last update of each rate.

For example:

the last row of rate 1 is (4 1 4),     
the last row of rate 2 is (6 2 2)     
and the last row of rate 3 is (9 3 3). 
Anfath Hifans
  • 1,588
  • 1
  • 11
  • 20
Israel
  • 33
  • 3

1 Answers1

1
select max(record), rate, max(update)
from your_table
group by rate
juergen d
  • 201,996
  • 37
  • 293
  • 362