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.

Django Aggregation - Expression contains mixed types. You must set output_field

I'm trying to achive an Aggregation Query and that's my code: TicketGroup.objects.filter(event=event).aggregate( total_group=Sum(…

django aggregate-functions django-queryset django-orm
Is there a better way to calculate the median (not average)

Suppose I have the following table definition: CREATE TABLE x (i serial primary key, value integer not null); I want …

sql postgresql aggregate-functions
How to set correct attribute names to a json aggregated result with GROUP BY clause?

I have a table temp defined like this: id | name | body | group_id ------------------------------- 1 | test_1 | body_1 | 1 2 | test_2 | body_2 | 1 3 | test_3 | body_3 | 2 4 | …

json postgresql types aggregate-functions postgresql-9.3
How to define a custom aggregation function to sum a column of Vectors?

I have a DataFrame of two columns, ID of type Int and Vec of type Vector (org.apache.spark.mllib.…

scala apache-spark apache-spark-sql aggregate-functions apache-spark-ml
How do I calculate a running SUM on a SQLite query?

How do I get a column that is the sum of all the values before of another column?

sql sqlite aggregate-functions
Cumulative sum of values by month, filling in for missing months

I have this data table and I'm wondering if is possible create a query that get a cumulative sum by …

sql postgresql aggregate-functions window-functions generate-series
Create nested json from sql query postgres 9.4

I need to get as a result from query fully structured JSON. I can see in postgres that there are …

sql json postgresql aggregate-functions postgresql-9.4
Aggregate List of objects in Java

Do we have any aggregator function in Java to perform the below aggregation? Person { String name; String subject; String department; …

java java-8 aggregate-functions java-stream
MySQL error 1054: Unknown column in having clause

Query: SELECT SUM(ProductCost) FROM `tblBasket` GROUP BY ProductCode HAVING BasketSessionID = '3429782d79c68834ea698bb4116eef5e' Showing Error …

sql mysql aggregate-functions mysql-error-1054
Counting the number of rows with a value greater than or equal to a value from another column in SQL

I have a table with two columns: a couple id and a number of "marks" for that couple. I'd like …

sql database aggregate-functions aggregation