Group by (SQL)

Group by (SQL)

A GROUP BY statement in SQL specifies that a SQL SELECT statement returns a list that is grouped by one or more columns, usually in order to apply some sort of aggregate function to certain columns.

Examples:

Returns a list of Department IDs along with the sum of their sales for the date of January 1, 2000. SELECT DeptID, SUM(SaleAmount) FROM Sales WHERE SaleDate = '01-Jan-2000'a group by statement can use a having clause to filter the number of rows... GROUP BY DeptID

Common grouping (aggregation) functions include:
* count("expression") - Quantity of matching records (per group)
* Sum("expression") - Summation of given value (per group)
* Min("expression") - Minimum of given value (per group)
* Max("expression") - Maximum of given value (per group)
* Avg("expression") - Average of given value (per group)

ee also

* Aggregate function


Wikimedia Foundation. 2010.

Игры ⚽ Поможем написать курсовую

Look at other dictionaries:

  • SQL-92 — SQL (das Kürzel für Structured Query Language; offizielle Aussprache [ɛskjuːˈɛl], häufig auch [ˈsiːkwəl] →SEQUEL), ist eine Datenbanksprache zur Definition, Abfrage und Manipulation von Daten in relationalen Datenbanken. SQL ist von ANSI und ISO… …   Deutsch Wikipedia

  • SQL-99 — SQL (das Kürzel für Structured Query Language; offizielle Aussprache [ɛskjuːˈɛl], häufig auch [ˈsiːkwəl] →SEQUEL), ist eine Datenbanksprache zur Definition, Abfrage und Manipulation von Daten in relationalen Datenbanken. SQL ist von ANSI und ISO… …   Deutsch Wikipedia

  • SQL — ist eine Datenbanksprache zur Definition, Abfrage und Manipulation von Daten in relationalen Datenbanken. SQL ist von ANSI und ISO standardisiert und wird von fast allen gängigen Datenbanksystemen unterstützt. Die Bezeichnung SQL (offizielle… …   Deutsch Wikipedia

  • SQL — This article is about the database language. For the airport with IATA code SQL, see San Carlos Airport. SQL Paradigm(s) Multi paradigm Appeared in 1974 Designed by Donald D. Chamberlin Raymond F. Boyce Developer …   Wikipedia

  • SQL injection — A SQL injection is often used to attack the security of a website by inputting SQL statements in a web form to get a badly designed website in order to dump the database content to the attacker. SQL injection is a code injection technique that… …   Wikipedia

  • SQL Access Group — Для улучшения этой статьи желательно?: Проставить шаблон карточку, который существует для предмета статьи. Пример использования шаблона есть в статьях на похожую тематику. Исправить статью согласно стилист …   Википедия

  • SQL Access Group — The SQL Access Group (SAG) was a group of software companies that was formed in 1989 to define and promote standards for database portability and interoperability. Initial members were Oracle Corporation, Informix, Ingres, DEC, Tandem, Sun and HP …   Wikipedia

  • SQL Server — Microsoft SQL Server SQL Server Développeur Microsoft Dernière …   Wikipédia en Français

  • SQL Server 2000 — Microsoft SQL Server SQL Server Développeur Microsoft Dernière …   Wikipédia en Français

  • SQL — Structured Query Language SQL Apparu en 1974 Auteur …   Wikipédia en Français

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”