Database.Guide

Skip to content

Beginners

  • What is a Database?
  • Database Tutorial

SQL

  • SQL Tutorial
  • SQL Reference
  • SQL Joins Tutorial
  • SQL Transactions Tutorial
  • Basic SQL Queries

Categories

  • Azure SQL Edge (17)
  • Database Concepts (99)
  • Database Tools (72)
  • DBMS (9)
  • DuckDB (151)
  • MariaDB (424)
  • Microsoft Access (17)
  • MongoDB (265)
  • MySQL (602)
  • NoSQL (8)
  • Oracle (301)
  • PostgreSQL (480)
  • Redis (210)
  • SQL (697)
  • SQL Server (1,170)
  • SQLite (299)

Tag: aggregation

SQLite JSON_GROUP_OBJECT()

Posted on March 23, 2022April 2, 2022 by Ian

The SQLite json_group_object() function is an aggregate function that returns a JSON object comprised of all name/value pairs in the aggregation.

In other words, it constructs a JSON object from the values provided by its arguments.

Continue reading →
SQLite aggregate functions, aggregation, functions, json, what is

SQLite JSON_GROUP_ARRAY()

Posted on March 22, 2022April 28, 2024 by Ian

The SQLite json_group_array() function is an aggregate function that returns a JSON array comprised of all values in the aggregation.

In other words, it constructs an array from the values provided by its argument.

Continue reading →
SQLite aggregate functions, aggregation, arrays, functions, json, what is

How to Get Multiple Rows into a Comma Separated List in SQL

Posted on January 26, 2022 by Ian

Most of the major RDBMSs have a function that enables us to return our query results as a comma separated list.

That is, we can use such a function to convert each row into a separate list item, within a comma separated list.

Below are examples of how to achieve this in some of the more popular RDBMSs.

Continue reading →
MariaDB, MySQL, Oracle, PostgreSQL, SQL, SQL Server, SQLite aggregation, how to

Convert Query Results to a Comma Separated List in MariaDB

Posted on January 19, 2022 by Ian

In MariaDB, we can use the GROUP_CONCAT() function to return our query results as a comma separated list. By that I mean, for a given column, we can convert all rows into a single row that contains a comma separated list of the values that made up that column. Each row is a separate item in the list.

Continue reading →
MariaDB aggregation, how to

SUM() Function in PostgreSQL

Posted on December 29, 2021 by Ian

In PostgreSQL, the SUM() function computes the sum of the non-null input values and returns the result.

In other words, it adds numbers and returns the result.

Continue reading →
PostgreSQL aggregate functions, aggregation, functions, what is

AVG() Function in PostgreSQL

Posted on December 26, 2021 by Ian

In PostgreSQL, the AVG() function computes the average (arithmetic mean) of all the non-null input values, and returns the result.

Continue reading →
PostgreSQL aggregate functions, aggregation, functions, what is

MAX() Function in PostgreSQL

Posted on December 14, 2021 by Ian

In PostgreSQL, the MAX() function computes the maximum of the non-null input values and returns the result.

This function can be used on any numeric, string, date/time, or enum type, as well as inet, interval, money, oid, pg_lsn, tid, and arrays of any of these types.

Continue reading →
PostgreSQL aggregate functions, aggregation, functions, what is

MIN() Function in PostgreSQL

Posted on December 14, 2021 by Ian

In PostgreSQL, the MIN() function computes the minimum of the non-null input values and returns the result.

This function can be used on any numeric, string, date/time, or enum type, as well as inet, interval, money, oid, pg_lsn, tid, and arrays of any of these types.

Continue reading →
PostgreSQL aggregate functions, aggregation, functions, what is

SUM() Function in MySQL

Posted on December 10, 2021July 21, 2023 by Ian

In MySQL, the SUM() aggregate function returns the sum of a given expression.

It can also be used to return the sum of all distinct (unique) values in an expression.

Continue reading →
MySQL aggregate functions, aggregation, functions, what is, window functions

Return Query Results as a Comma Separated List in Oracle

Posted on December 9, 2021 by Ian

In Oracle, we can use the LISTAGG() function to convert our query results to a comma separated list.

So, instead of each value being output in a separate row, all values are output in a single row, separated by a comma (or some other delimiter of our choosing).

Continue reading →
Oracle aggregation, how to
  • «
  • 1
  • …
  • 3
  • 4
  • 5
  • 6
  • 7
  • …
  • 21
  • »

About Database.Guide | Privacy Policy