Top "Aggregate-functions" questions

Aggregate functions are a subset of SQL functions that compute a single value from multiple input rows, mostly used in `SELECT` queries with a `GROUP BY` clause.

SQL: aggregate functions with DATE type columns

I stumbled upon a question (in a test) about which aggregate functions are applicable to DATE type columns. So, as …

sql date aggregate-functions ansi-sql
How to use a SQL window function to calculate a percentage of an aggregate

I need to calculate percentages of various dimensions in a table. I'd like to simplify things by using window functions …

sql postgresql aggregate-functions window-functions greenplum
Is there ANY_VALUE capability for mysql 5.6?

currently im working with mysql 5.7 in development, and 5.6 in production. Each time i run a query with a group by …

mysql group-by aggregate-functions mysql-error-1055
in postgres select, return a column subquery as an array?

(have done this before, but memory fades, as does goggle) wish to get select from users with the tag.tag_…

arrays postgresql subquery aggregate-functions
Executing queries dynamically in PL/pgSQL

I have found solutions (I think) to the problem I'm about to ask for on Oracle and SQL Server, but …

postgresql aggregate-functions plpgsql dynamic-sql dynamic-queries
How to sort by annotated Count() in a related model in Django

I'm building a food logging database in Django and I've got a query related problem. I've set up my models …

django django-models aggregate-functions django-queryset
Return true if all column values are true

Is there a faster way in PostgreSQL to essentially do an if on several rows? Say I have a table …

sql postgresql aggregate-functions exists boolean-logic
How to load extensions into SQLite?

I need a standard deviation function in SQLite. I have found one here: http://www.sqlite.org/contrib?orderby=date …

sql sqlite aggregate aggregate-functions standard-deviation
replace NULL values with latest non-NULL value in resultset series (SQL Server 2008 R2)

for SQL Server 2008 R2 I have a resultset that looks like this (note [price] is numeric, NULL below represents a …

sql-server aggregate-functions sql-server-2008-r2 analytic-functions
SQL select elements where sum of field is less than N

Given that I've got a table with the following, very simple content: # select * from messages; id | verbosity ----+----------- 1 | 20 2 | 20 3 | 20 4 | 30 5 | 100 (5 rows) …

sql sqlite postgresql aggregate-functions sql-limit