John M, 
Thanks for the solution, gave me exactly what I was looking for. 

Thanks, 
James

-----Original Message-----
From: John McCaskey [mailto:[EMAIL PROTECTED] 
Sent: Thursday, April 22, 2004 3:54 PM
To: James; [EMAIL PROTECTED]
Subject: RE: Last Record Pulling my hair out :D

Try, SELECT * FROM job_log_2004 ORDER BY JobID DESC LIMIT 1.  This is
simpler than your sub select method and probably faster.  Sub selects
don't work in MySQL 4.x so if you are not using a newer beta build that
is probably why it fails.

John A. McCaskey

-----Original Message-----
From: James [mailto:[EMAIL PROTECTED] 
Sent: Thursday, April 22, 2004 12:43 PM
To: [EMAIL PROTECTED]
Subject: Last Record Pulling my hair out :D


I'm trying to select the last record (row) in a db.  I'm trying with a
select:
Select * from job_log_2004 where job_log_2004.JobID = (select
max(job_log_2004.JobID) from job_log_2004) and it fails.  The part about
select max works and returns a number. What on earth am I doing wrong?
Or is there an easier way to return the last record? Thanks

Thanks, 
James 





-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:
http://lists.mysql.com/[EMAIL PROTECTED]


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:
http://lists.mysql.com/[EMAIL PROTECTED]




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to