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.

Fetching Minimum/Maximum for each group in ActiveRecord

This is an age-old question where given a table with attributes 'type', 'variety' and 'price', that you fetch the record …

activerecord group-by aggregate-functions minimum
Using Aggregate functions in DataView filters

i have a DataTable that has a column ("Profit"). What i want is to get the Sum of all the …

c# datatable dataview aggregate-functions filter
Oracle SQL Hierarchical Query: Flatten Hierarchy and Perform Aggregation

I am trying to improve performance for a proof of concept I have already written and am having no luck. …

sql oracle aggregate-functions hierarchical-data hierarchical
Select running total until specific SUM is reached

I am trying to select the first n rowid values from the following table variable that will get me as …

sql-server cursor aggregate-functions cumulative-sum
Aggregate functions on multiple joined tables

I have three tables: CREATE TABLE foo ( id bigint PRIMARY KEY, name text NOT NULL ); CREATE TABLE foo_bar ( id …

sql postgresql left-join aggregate-functions cross-join
Postgres query result to json object

My query is given below SELECT w.payload, Count('payload') OVER () AS ROWCOUNT FROM wholesale_confirmation.wholesale_order_confirmation w …

postgresql pagination aggregate-functions jsonb sql-limit
Using MAX with multiple tables

I have a four tables: products, pc, laptop, and printer. Products(maker, model, type) PC(code, model, speed, hd, cd, …

sql subquery union aggregate-functions multiple-tables
Optimizing COUNT(DISTINCT) slowness even with covering indexes

We have a table in MySql with arround 30 million records, the following is table structure CREATE TABLE `campaign_logs` ( `domain` …

mysql sql aggregate-functions query-performance mysql-variables
Aggregation $lookup with $let is not working

I have a collection TblStudent in mongodb like { "_id": ObjectId("5baa85041d7859f40d000029"), "Name": "John Doe", "RollNo": 12, "Class": "Ist" .... } …

mongodb aggregation-framework aggregate-functions mongodb-php php-mongodb
User defined function to be applied to Window in PySpark?

I am trying to apply a user defined function to Window in PySpark. I have read that UDAF might be …

apache-spark pyspark aggregate-functions user-defined-functions window-functions