About 50 results
Open links in new tab
  1. sql - Query with aggregate functions is very slow - Stack Overflow

    Sep 9, 2025 · Query with aggregate functions is very slow Ask Question Asked 6 months ago Modified 6 months ago

  2. sql - Why do aggregation functions work without Group By ... - Stack ...

    Jun 23, 2023 · According to Itzik Ben-Gan in his book T-SQL fundamentals (a book that I really enjoyed), when using aggregation functions, you would need to include a GROUP BY clause to specify the …

  3. Aggregate SQL Function to grab only the first from each group

    Apr 21, 2017 · 2 First and Last do not exist in Sql Server 2005 or 2008, but in Sql Server 2012 there is a First_Value, Last_Value function. I tried to implement the aggregate First and Last for Sql Server …

  4. sql - GROUP BY without aggregate function - Stack Overflow

    Nov 19, 2013 · SQL requires that if a column is in the SELECT clause and is not used within an aggregate function, it must be included in the GROUP BY clause. Since resource.rId is selected but …

  5. Aggregate function in SQL WHERE-Clause - Stack Overflow

    May 13, 2014 · If you are using an aggregate function in a where clause then it means you want to filter data on the basis of that aggregation function. In my case, it's SUM().

  6. Custom aggregate function (concat) in SQL Server

    Dec 7, 2010 · The only type of functions you can write in pure T-SQL are scalar and table valued functions. Compare the pages for CREATE AGGREGATE, which only lists CLR style options, with …

  7. Is there really no First/Last aggregate function in T-SQL?

    Aug 24, 2023 · No - there are no such aggregate functions in TSQL. The problem with FIRST and LAST is that you need a way of specifying that the rows going into the aggregate should be treated as …

  8. sql - Why "first" or "any" aggregate functions are not commonly used …

    Oct 18, 2017 · Regarding any Standard SQL has an aggregate function any but for a different use case. Again, what you (MS Access SQL) suggest for any gives you a non-deterministic result, which is not …

  9. Why are aggregate functions not allowed in where clause

    @AlexPoole - I read the question to mean, "Why did the designers of SQL need to restrict the use of aggregate functions, so they can only be in a HAVING clause and not in WHERE?

  10. sql - Optimal way to concatenate/aggregate strings - Stack Overflow

    I'm finding a way to aggregate strings from different rows into a single row. I'm looking to do this in many different places, so having a function to facilitate this would be nice. I've tried solu...