Another solution :
For your  query, try "SELECT MAX(id) FROM table"
That works with mysql.


-----Message d'origine-----
De : dan [mailto:[EMAIL PROTECTED] 
Envoyé : samedi 25 octobre 2003 11:44
À : [EMAIL PROTECTED]
Objet : SQL Syntax quickie


Hi,

I've looked around to not much avail, what I'm looking for is a SELECT
query that selects the last record in a database. Each table has the
primary field "id", to which auto increments on each input. I don't want
to have to load the entire db, cycle through it until I find the last
one, the program needs to react fast, not being slowed down by having to
cycle through database records.

Basically what happens is the program enters information using INSERT,
and then it needs to re-read the data it's just sent to verify it, and
get the id number that auto_increment assigned it.

Is this possible? Does this make sense? *laugh*

Many thanks,
Dan



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.530 / Virus Database: 325 - Release Date: 22/10/2003
 



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to