Hi everybody, here I am the last day of the year with one problem...

this is my table:
Code:
id useridfrom useridto message 
1    5          15        A
2    5          15        B
3   10           8        C
4    2          15        D
5   10          15        E
6    2           6        F
7   10          15        G
what I want is:
Code:
id useridfrom message
2    5           B
4    2           D
7   10           G
for one useridto (for example, useridto=15) I want the max(id) for each useridfrom

I thought I could use this query:
Code:
SELECT max( id ) , useridfrom, message
FROM messages
WHERE useridto =15
GROUP BY useridfrom
but the result doesnīt seem to be correct

any idea about how can I do it? if itīs not possible with group, how could I do it?

Iīm using mysql 4.0.22

thanks and happy new year