Vue d’ensemble
L'instruction LIMIT restreint le nombre maximal d'enregistrements à conserver dans la table de travail actuelle. Un entier non négatif doit être spécifié dans l'instruction LIMIT.
<instruction limite> ::= "LIMIT" <entier non négatif>
Exemple de Graph
Les exemples suivants sont exécutés sur ce graph :

Pour créer ce graph, exécutez la requête suivante sur un graph vide :
INSERT (p1:Paper {_id:'P1', title:'Efficient Graph Search', score:6, author:'Alex'}),
(p2:Paper {_id:'P2', title:'Optimizing Queries', score:9, author:'Alex'}),
(p3:Paper {_id:'P3', title:'Path Patterns', score:7, author:'Zack'}),
(p1)-[:Cites {weight:2}]->(p2),
(p2)-[:Cites {weight:1}]->(p3)
Limitation des Enregistrements Retournés
MATCH (n:Paper)
RETURN n.title LIMIT 2
Résultat :
| n.title |
|---|
| Efficient Graph Search |
| Optimizing Queries |
Limitation des Enregistrements Transmis
MATCH (n:Paper) LIMIT 1
MATCH p = (n)->()
RETURN p
Résultat :
| p |
|---|
| (:Paper {_id: "P2", score: 9, title: "Optimizing Queries", author: "Alex"})-[:Cites {weight: 1}]->(:Paper {_id: "P3", score: 7, title: "Path Patterns", author: "Zack"}) |
Limitation des Enregistrements Ordonnés
MATCH (n:Paper)
ORDER BY n.title DESC
LIMIT 1
RETURN n.title
Résultat :
| n.title |
|---|
| Path Patterns |