bonjour
j'ai cette table
je voudrais sortir l'enregistrement le plus récent, j'ai essayé ça :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8 CREATE TABLE `TJ_APP_DI_REL` ( `no_di` int NOT NULL, `mat_util` int NOT NULL, `date_rel` date NOT NULL, `heure_rel` time NOT NULL, FOREIGN KEY(no_di) REFERENCES T_DI(no_di), FOREIGN KEY(mat_util) REFERENCES T_UTIL(mat_util) )TYPE = InnoDB;
ça me renvoit le plus ancien si j'enlève DESC idem
Code : Sélectionner tout - Visualiser dans une fenêtre à part SELECT * FROM tj_app_di_rel WHERE no_di=5 order by date_rel, heure_rel DESC LIMIT 1
comment faire ?
Balises ajoutées par Magnus, merci d'y penser à l'avenir
Partager