[thelist] Doh! question for MySQL

walker walker at sdproductions.com
Tue Feb 13 21:00:47 CST 2001

Hello out there...

I'm looking for a little sql syntax on mysql.

I need a way to select the last 10inserts into a db table. I know this is 
probably simple, but I can't seem to get it.

I was thinking about doing this:

select count(orderitemid) as oidcount from orderitem;

then set a new variable (oidmin) to the result of the previous query - 10

select * from orderitem limit oidmin,10;

seems like there might be a cleaner way to do this. Any suggestions?



walker fenton
walker at sdproductions.com

More information about the thelist mailing list