RE: Query last record in table

2004-07-05 Thread Scott Johnson
Hi Tia, I'm not sure, but my old SQL trick was to do a "select * top 1 from subscribers order by acctid desc" Scotty. -Original Message- From: Mike Blezien [mailto:[EMAIL PROTECTED] Sent: July 5, 2004 2:52 PM To: MySQL List Subject: Query last record in table Hello, w

[Fwd: Query last record in table]

2004-07-05 Thread Mike Blezien
cancel this, found my problem :) this query worked: SELECT * FROM subscribers ORDER BY acctid DESC LIMIT 1 Original Message Subject: Query last record in table Date: Mon, 05 Jul 2004 13:52:28 -0500 From: Mike Blezien <[EMAIL PROTECTED]> Reply-To: [EMAIL PROTECTED] Organi

Re: Query last record in table

2004-07-05 Thread Paul DuBois
At 13:52 -0500 7/5/04, Mike Blezien wrote: Hello, what is the most effecient way to query the last record in a table, if querying the primary key(acctid) column ?? What do you mean by "last"? The row containing the largest acctid value? You might try ... ORDER BY acctid DESC LIMIT 1. I've tried "

Query last record in table

2004-07-05 Thread Mike Blezien
Hello, what is the most effecient way to query the last record in a table, if querying the primary key(acctid) column ?? I've tried "select *,max(acctid) as lastid from subscribers where acctid = 'lastid' group by acctid" but this returns nothing ?? TIA :) -- MikeBlezien =-=-=-=-=-=-=-=-=-=-=-=