doc/book/en/annexes/rql/language.rst
branchstable
changeset 7081 6beb7f1e05fa
parent 6324 bdb85e3602c8
child 7529 2fdc310be7cd
equal deleted inserted replaced
7080:a828feedc164 7081:6beb7f1e05fa
   151   ascendant (`ASC`).
   151   ascendant (`ASC`).
   152 
   152 
   153 - Aggregate Functions: COUNT, MIN, MAX, AVG, SUM, GROUP_CONCAT
   153 - Aggregate Functions: COUNT, MIN, MAX, AVG, SUM, GROUP_CONCAT
   154 
   154 
   155 Having
   155 Having
   156 ``````
   156 ```````
   157 
   157 
   158 The HAVING clause, as in SQL, has been originally introduced to restrict a query
   158 The HAVING clause, as in SQL, has been originally introduced to restrict a query
   159 according to value returned by an aggregate function, e.g.::
   159 according to value returned by an aggregate function, e.g.::
   160 
   160 
   161     Any X GROUPBY X WHERE X relation Y HAVING COUNT(Y) > 10
   161     Any X GROUPBY X WHERE X relation Y HAVING COUNT(Y) > 10
   212 
   212 
   213     Any P ORDERBY N LIMIT 5 OFFSET 10 WHERE P is Person, P firstname N
   213     Any P ORDERBY N LIMIT 5 OFFSET 10 WHERE P is Person, P firstname N
   214 
   214 
   215 
   215 
   216 Exists
   216 Exists
   217 ``````
   217 ```````
       
   218 
       
   219 You can use `EXISTS` when you want to know if some expression is true and do not
       
   220 need the complete set of elements that make it true. Testing for existence is
       
   221 much faster than fetching the complete set of results.
       
   222 
   218 ::
   223 ::
   219 
   224 
   220     Any X ORDERBY PN,N
   225     Any X ORDERBY PN,N
   221     WHERE X num N, X version_of P, P name PN,
   226     WHERE X num N, X version_of P, P name PN,
   222           EXISTS(X in_state S, S name IN ("dev", "ready"))
   227           EXISTS(X in_state S, S name IN ("dev", "ready"))