Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
1299 connectés 

  FORUM HardWare.fr
  Programmation
  PHP

  select * from sondage where " id le plus grand

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

select * from sondage where " id le plus grand

n°194311
mystik23
Wind!!!! rulezzz
Posté le 12-08-2002 à 21:32:27  profilanswer
 

voila c pour un sondage, je voudrais selectionne dans le table la lign ou le id est le plus grand
 
ca doit etre un petite astuce mais je trouve pas  
 
merci a tous


---------------
Qui mange un noix de coco entiere fait confiance a son anus
mood
Publicité
Posté le 12-08-2002 à 21:32:27  profilanswer
 

n°194324
Sh@rdar
Ex-PhPéteur
Posté le 12-08-2002 à 21:56:34  profilanswer
 

SELECT * FROM matable ORDER BY id DESC LIMIT 1


---------------
La musique c'est comme la bouffe, tu te souviens du restaurant dans lequel t'as bien mangé 20 ans plus tôt, mais pas du sandwich d'il y a 5 minutes :o - Plugin pour winamp ©Harkonnen : http://harko.free.fr/soft
n°194601
mystik23
Wind!!!! rulezzz
Posté le 13-08-2002 à 13:42:51  profilanswer
 

merci je vais tester ca


---------------
Qui mange un noix de coco entiere fait confiance a son anus
n°200310
Kyle
Posté le 23-08-2002 à 02:04:52  profilanswer
 
n°200523
Core 666
Posté le 23-08-2002 à 13:31:30  profilanswer
 

mystik23 a écrit a écrit :

merci je vais tester ca




Choisi plutôt la solution proposée dans le lien de Kyle. C'est bien plus performant :)

n°200593
MagicBuzz
Posté le 23-08-2002 à 14:46:08  profilanswer
 

tomiotomio a écrit a écrit :

ca marche malheureusement pas avec toutes les BD




Si cette syntaxe marche pas, généralement, celle-ci la remplace :
 
SELECT TOP 1 * FROM SONDAGE ORDER BY ID DESC

n°200912
Dost67
Posté le 23-08-2002 à 18:52:47  profilanswer
 

Kyle et Core je crois que vous n'avez pas compris la question !

n°200967
Core 666
Posté le 23-08-2002 à 21:15:26  profilanswer
 

Oups, effectivement, j'avais mal lu :jap:

n°200969
HappyHarry
Posté le 23-08-2002 à 21:25:59  profilanswer
 

select * from tatable where id=(select max(id) from tatable)
 
mais ca marche pas en mysql

n°201045
MagicBuzz
Posté le 23-08-2002 à 22:35:43  profilanswer
 

HappyHarry a écrit a écrit :

select * from tatable where id=(select max(id) from tatable)
 
mais ca marche pas en mysql




En autant utiliser ma requête dans ce cas (Oracle & MS SQL)


Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  PHP

  select * from sondage where " id le plus grand

 

Sujets relatifs
problème avec WHERE pour récup de données... (résolu)[sondage, graphisme] comment dessiner un camembert ?
SQL recuperer le plus grand idmodifier les bords d'un select
need help pour mettre a jour un selectProblème css style SELECT
[C] Equivalent a la fonction select()[MYSQL] : un select where sur un INDEX, et mysql l'utilise pas !!
[MySQL] Rapidité d'un SELECT ... 
Plus de sujets relatifs à : select * from sondage where " id le plus grand


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR