About 8,890,000 results
Open links in new tab
  1. Count number of records returned by group by - Stack Overflow

    Jun 16, 2016 · The group by doesn't change the number of rows though. 1 + 1 + 2 (in your example) will be the number of rows in the table. Are you looking for 3? The number of distinct …

  2. sql - How to use count and group by at the same select statement ...

    Apr 27, 2010 · I have an SQL SELECT query that also uses a GROUP BY, I want to count all the records after the GROUP BY clause filtered the resultset. Is there any way to do this directly …

  3. sql - How to combine GROUP BY and ROW_NUMBER? - Stack …

    What i need is commented above, a way to get the ROW_NUMBER but also to Group By in the first place. So i need the sum of all T1-prices grouped by T2.ID in the relation-table and in the …

  4. What is the difference between PARTITION BY and GROUP BY

    The SQL GROUP BY clause can be used in a SELECT statement to collect data across multiple records and group the results by one or more columns. In more simple words GROUP BY …

  5. Get records with max value for each group of grouped SQL results

    Aug 24, 2012 · How do you get the rows that contain the max value for each grouped set? I've seen some overly-complicated variations on this question, and none with a good answer. I've …

  6. sql - Select max value of each group - Stack Overflow

    The select list has 2 fields: name and value. Name is in the group by clause and value is aggregated via max. I cannot see any version of the answer where there would have been …

  7. SQL Inner Join with Group By - Stack Overflow

    Dec 12, 2013 · 0 Besides adding entries in your group by statement, you could also write it as a CTE using the with statement. You define the result set of the sums first, and then use a …

  8. SQL - using alias in Group By - Stack Overflow

    SQL Server doesn't allow you to reference the alias in the GROUP BY clause because of the logical order of processing. The GROUP BY clause is processed before the SELECT clause, …

  9. Check users in a security group in SQL Server - Stack Overflow

    In the Security/Users folder in my database, I have a bunch of security groups, include "MyApplication Users". I need to check if I am (or another user is) in this group, but I have no …

  10. sql - How can I group time by hour or by 10 minutes? - Stack …

    How do you group by whole date and by hours in the same time? I'm just using Min Date .