MySQL Forums
Forum List  »  French

Re: Last ID
Posted by: Julien Stuby
Date: September 15, 2008 04:24PM

[1] Obtenir ID auto incrément d'un insert :
Donc je suis obligé de lancer deux requêtes pour pouvoir récupérer un ID auto incrément d'un insert.
- La première requête qui va introduire le dernier enregistrement de la table (celle qui va générer le auto incrément)
- La deuxième pour obtenir le auto incrément via la fonction MAX (ID) ou un ORDER BY ID DESC LIMIT 1

[2] Obtenir les dernières lignes ajoutées après un ID :
Requête nommée: checkForNewRowFrom($ID) {
SELECT * FROM table WHERE ID>$ID
}
Serait-il possible d'inverser le sens de lecture de la table ?
(Au lieu de partir du bas de la table ''les insert les plus ancien'', partir de haut de la table vers le bas ''les derniers insert ajoutés'')

Cordialement,
SORENSEN



Edited 4 time(s). Last edit at 09/15/2008 04:35PM by Julien Stuby.

Options: ReplyQuote


Subject
Views
Written By
Posted
18668
April 02, 2008 06:40PM
5905
April 02, 2008 11:44PM
5156
April 03, 2008 12:21PM
4841
April 04, 2008 10:38AM
4841
April 04, 2008 09:34PM
5095
June 11, 2008 04:34PM
Re: Last ID
4790
September 15, 2008 04:24PM
4493
September 16, 2008 08:10AM
3718
September 17, 2008 06:19PM
4141
September 22, 2008 08:36AM
4104
September 22, 2008 03:07PM
3972
September 23, 2008 08:45AM
4303
September 26, 2008 07:20AM
4346
September 26, 2008 04:19PM
4003
December 27, 2008 01:07PM
4217
December 26, 2008 10:07PM
5006
April 08, 2008 01:14AM
5539
June 09, 2008 04:47PM
3692
December 27, 2008 01:02PM
3992
February 05, 2009 08:40PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.