I have a table that contains id, name, message, and date.
I would like to pull the 10 last posted messages, but have a hard time doing it. I would also like to take into consideration that ids might not be consecutive as some messages get deleted.
Maybe I am doing it wrong.
This is what I am trying with no success:
select * from messages where id > max(id)-10;
this gives me a ERROR 1111: Invalid use of group function.
Can anyone please please suggest what I am not doing right?
I also tried different variations of the above query with disaster... =(