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

  FORUM HardWare.fr
  Programmation
  SQL/NoSQL

  [oracle] LIMIT

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

[oracle] LIMIT

n°445743
art_dupond
je suis neuneu... oui oui !!
Posté le 01-07-2003 à 23:24:00  profilanswer
 

youp,
 
 
 
c'est possible de faire un LIMIT comme dans mysql pour afficher n'avoir qu'un certain nombre de ligne de la requete avec ORACLE ?
 
 
apparemment non, mais y a peut etre un moyen :??:  
 
 
 
 
merci
 
 
 
je suis neuneu ! n'est-ce pas ?


---------------
oui oui
mood
Publicité
Posté le 01-07-2003 à 23:24:00  profilanswer
 

n°445798
art_dupond
je suis neuneu... oui oui !!
Posté le 01-07-2003 à 23:47:33  profilanswer
 

bon j'ai trouvé qu'on pouvait faire  
 
 
select ... where rownum < limite
 
 
 
mais je sais toujours pas par exemple avoir les lignes 50 à 100 :(
 
 
 
edit:
 
bon ben voilà...
 
ROWNUM returns a number indicating the sequence in which a row was selected from a table. The first row selected has a ROWNUM of 1, the second row has a ROWNUM of 2, and so on. If a SELECT statement includes an ORDER BY clause, ROWNUMs are assigned to the selected rows before the sort is done.  
 
You can use ROWNUM to limit the number of rows returned by a SELECT statement. Also, you can use ROWNUM in an UPDATE statement to assign unique values to each row in a table. Using ROWNUM in the WHERE clause does not stop the processing of a SELECT statement; it just limits the number of rows retrieved. The only meaningful use of ROWNUM in a WHERE clause is  
 
     ... WHERE ROWNUM < constant
 
 
because the value of ROWNUM increases only when a row is retrieved. The following search condition can never be met because the first four rows are not retrieved:  
 
     ... WHERE ROWNUM = 5
 
the only caveat to this is ... WHERE ROWNUM = 1


Message édité par art_dupond le 02-07-2003 à 00:05:36

---------------
oui oui

Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  SQL/NoSQL

  [oracle] LIMIT

 

Sujets relatifs
Installation d'Oracle : pb PLSQL ORA-06544[Oracle] Requete conditionnelle
[ORACLE] comparaison de dateJRE et ORACLE
[Oracle] comment marche to_date ???Comment sauvegardez vous votre base oracle ?
Fonction équivalente au decode de Oracle?[Oracle] comparer des valeurs
[SQL] Oracle, choisir plusieurs dates différentesHELLLPPP probleme sql avec oracle (VB, adodc, odbc)
Plus de sujets relatifs à : [oracle] LIMIT


Copyright © 1997-2025 Groupe LDLC (Signaler un contenu illicite / Données personnelles)