About 50 results
Open links in new tab
  1. Is it possible to specify condition in Count ()? - Stack Overflow

    Is it possible to specify a condition in Count()? I would like to count only the rows that have, for example, "Manager" in the Position column. I want to do it in the count statement, not using WH...

  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 with …

  3. How can I get multiple counts with one SQL query?

    Note that as an alternative to distinct, as I have made the correction, you can also/better use group by with the benefit of replacing an entire nested query with a simple count(*) as @Mihai shows - with …

  4. Count(*) vs Count(1) - SQL Server - Stack Overflow

    Aug 3, 2009 · 904 Just wondering if any of you people use Count(1) over Count(*) and if there is a noticeable difference in performance or if this is just a legacy habit that has been brought forward …

  5. sql - COUNT CASE and WHEN statement in MySQL - Stack Overflow

    Feb 18, 2011 · How to use COUNT CASE and WHEN statement in MySQL query, to count when data is NULL and when it is not NULL in one MySQL query?

  6. Count number of records returned by group by - Stack Overflow

    Jun 16, 2016 · How do I count the number of records returned by a group by query, For eg: select count(*) from temptable group by column_1, column_2, column_3, column_4 Gives me, 1 1 2 I need …

  7. t sql - SQL Count for each date - Stack Overflow

    tbl_leads id int, first_name nvarchar(100), last_name nvarchar(100), created_date datetime And I need to count the number of leads for each day, 10 days total. SO the result set should look something like …

  8. How to count occurrences of a column value efficiently in SQL?

    How to count occurrences of a column value efficiently in SQL? Asked 16 years, 4 months ago Modified 1 year, 11 months ago Viewed 714k times

  9. Can I do a max (count (*)) in SQL? - Stack Overflow

    May 10, 2017 · Consider the sequence of events in a SELECT query: Best way to get result count before LIMIT was applied Possible downside: window functions do not aggregate rows. You get all …

  10. How can you use COUNT() in a comparison in a SELECT CASE clause in …

    Oct 30, 2012 · SELECT CASE WHEN (SELECT COUNT(id) FROM table WHERE column2 = 4) > 0 THEN 1 ELSE 0 END Basically just return 1 when there's one or more rows in the table, 0 otherwise. …