Page 1 of 1

"SELECT * FROM proyects WHERE proyect_num >= MAX(pro

Posted: Sat Feb 26, 2005 11:57 am
by newlame
Help, I have a table called proyects with this fields:
proyect_num | date_added | filename | description | title

proyect_num is a auto_increment.


but I want to do something like this:

Code: Select all

"SELECT * FROM proyects WHERE proyect_num >= MAX(proyect_num) - 5"
So i want to select the last 5 proyect_num's, how can I do that?

Posted: Sat Feb 26, 2005 12:35 pm
by newlame
don't need anymore help, I just figured it out:

Code: Select all

SELECT * FROM proyects ORDER BY proyect_num DESC LIMIT 5