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.

DISTINCT ON in an aggregate function in postgres

For my problem, we have a schema whereby one photo has many tags and also many comments. So if I …

sql json postgresql distinct aggregate-functions
Two SQL LEFT JOINS produce incorrect result

I have 3 tables: users(id, account_balance) grocery(user_id, date, amount_paid) fishmarket(user_id, date, amount_paid) Both …

sql postgresql left-join aggregate-functions
Why is count(distinct) slower than group by in Hive?

On Hive, I believe count(distinct) will be more likely than group-by to result in an unbalanced workload to reducers …

performance hive aggregate-functions
Extra Fields with SQL MIN() & GROUP BY

When using the SQL MIN() function, along with GROUP BY, will any additional columns (not the MIN column, or one …

sql mysql aggregate-functions
Generate_series in Postgres from start and end date in a table

I have been trying to generate a series of dates (YYYY-MM-DD HH) from the first until the last date in …

sql postgresql aggregate-functions generate-series
Aggregate Relational Algebra (Maximum)

I am currently working on a homework assignment that requires a selection to occur that pulls out an element containing …

sql aggregate aggregate-functions max relational-algebra
Postgres window function and group by exception

I'm trying to put together a query that will retrieve the statistics of a user (profit/loss) as a cumulative …

sql postgresql aggregate-functions window-functions
Spring Data JPA - Custom Query with multiple aggregate functions in result

I was trying to return an average and count of a set of ratings in one query. I managed it …

java spring jpa spring-data aggregate-functions
string concatenate in group by function with other aggregate functions

Is it possible to concatenate strings with one or more of other group by function like sum, avg, count etc . …

sql sql-server tsql aggregate-functions sql-server-group-concat
SQL: tuple comparison

In my current application, I need to be able to do this type of query: SELECT MIN((colA, colB, colC)) …

mysql sql aggregate-functions row-value-expression