La funció COUNT() retorna el nombre de files que coincideix amb un criteri especificat. La funció AVG() retorna el valor mitjà d'una columna numèrica. La funció SUM() retorna la suma total d'una columna numèrica.
COUNT() Exemple
La següent instrucció SQL troba el nombre de productes:
Nota: els valors NULL no es compten.
SQL:
SELECT COUNT(ProductID) FROM Products;
GenQL:
Long count;
count = getProductsManager().count(ProductsFields.PRODUCTID.isNotNull());
print(count, "Total");
AVG() Exemple
La següent instrucció SQL troba el preu mitjà de tots els productes: