About 1,610,000 results
Open links in new tab
  1. How do I select columns together with aggregate functions?

    Jun 23, 2012 · SQL Server requires that all non-aggregated columns be specified in GROUP BY. Therefore your GROUP BY clause should look like this: c.coID, c.coName, a.ahFirstName, …

  2. How to use reference to another table in aggregate function

    Nov 2, 2016 · I have following easy-to-explain task: we have a table, and we should calculate total count of rows grouped by columns. Column number is fixed so we write: SELECT [GroupId] = …

  3. Aggregate Functions (Transact-SQL) - SQL Server | Microsoft Learn

    May 23, 2023 · An aggregate function performs a calculation on a set of values, and returns a single value. Except for COUNT(*) , aggregate functions ignore null values. Aggregate …

  4. SQL Aggregate Functions - W3Schools

    SQL Aggregate Functions. An aggregate function is a function that performs a calculation on a set of values, and returns a single value. Aggregate functions are often used with the GROUP BY …

  5. How to Combine Two Aggregate Functions in SQL - LearnSQL.com

    Jun 7, 2022 · Learn how to combine two aggregate functions in one SQL query by using a subquery or a Common Table Expression (CTE).

  6. SQL Aggregate functions - GeeksforGeeks

    Apr 15, 2025 · SQL Aggregate Functions are used to perform calculations on a set of rows and return a single value. These functions are particularly useful when we need to summarize, …

  7. SQL Server - Reference a column by name in aggregate function

    SELECT [Column] as [Name], [MaxLength], MAX(LEN([Column])) as [MaxUsedLength], AVG(LEN([Column])) as [AvgUsedLength], STDEV(LEN([Column])) as [StdDev] FROM …

  8. SQL Aggregate Functions - SQL Tutorial

    Summary: in this tutorial, you will learn about the SQL aggregate functions including AVG(), COUNT(), MIN(), MAX(), and SUM(). An SQL aggregate function calculates on a set of values …

  9. Is it possible to make a reference to the result of an aggregate ...

    Only your ORDER BY clause can reference assigned aliases in the same query. I suggest declaring a CTE that computes the first value, and then computing the second value in a query …

  10. Aggregation in SQL: Functions and Practical Examples

    Jan 20, 2025 · SQL aggregate functions help you process multiple records with similar data and support your business intelligence efforts. In this section, you will find a simplified explanation …

  11. Some results have been removed
Refresh