Page 1 of 1

Mysql Math question

Posted: Wed Apr 27, 2005 8:39 pm
by Texan
I am trying to do something. I don't even know if it will work.
Will this work? Or do I need to do it someother way?

Code: Select all

SELECT * FROM Logs WHERE id > MAX(id)-7 ORDER BY date_entered
I am trying to only show the last 7 entries in the Logs table.
I know its stupid, and there has to be an easier way to do this,
but I am very tired and not thinking quite straight.

Thanks

lol

Posted: Wed Apr 27, 2005 8:53 pm
by method_man
get some rest lol

Posted: Wed Apr 27, 2005 8:57 pm
by Texan
Thanks I would love to.....but this will haunt me till
I finish it. But 2 karma points for wishing me some much
needed sleep.


Hit me up for 6 pack sometime....

lol

Posted: Wed Apr 27, 2005 9:03 pm
by method_man
lol
yes i got 2 karma points
what can i get with karma points? lol

Posted: Wed Apr 27, 2005 9:16 pm
by Texan
I don't know...a bus ticket or something?

Posted: Wed Apr 27, 2005 10:27 pm
by hawleyjr
Please show your table stucture.

Posted: Wed Apr 27, 2005 10:29 pm
by hawleyjr
Try This:

Code: Select all

SELECT * FROM Logs ORDER BY date_entered DESC limit 0,7