About 172,000 results
Open links in new tab
  1. sql - Selecting COUNT (*) with DISTINCT - Stack Overflow

    656 In SQL Server 2005 I have a table cm_production that lists all the code that's been put into production. The table has a ticket_number, program_type, program_name and push_number …

  2. SQL to find the number of distinct values in a column

    SELECT COUNT(DISTINCT column_name) AS some_alias FROM table_name This will count only the distinct values for that column.

  3. sql - COUNT DISTINCT with CONDITIONS - Stack Overflow

    Dec 27, 2012 · tag | entryID ----+--------- foo | 0 foo | 0 bar | 3 If I want to count the number of distinct tags as "tag count" and count the number of distinct tags with entry id > 0 as "positive …

  4. SQL count(*) and distinct - Stack Overflow

    Dec 1, 2009 · Why can't we use count (distinct *) in SQL? As in to count all distinct rows?

  5. Difference Between Distinct Count () and Count (Distinct)

    May 27, 2021 · Here, because there is a single row, the distinct has no effect; there's only one row and it's always going to be distinct. But if there were multiple rows, perhaps because there's a …

  6. sql - Counting DISTINCT over multiple columns - Stack Overflow

    Sep 24, 2009 · SELECT COUNT(*) FROM (SELECT DISTINCT DocumentId, DocumentSessionId FROM DocumentOutputItems) AS internalQuery I need to count the number of distinct items …

  7. SQL - how to count unique combination of columns

    Dec 15, 2011 · I'm not sure if this is possible but I want to count the number of unique value in a table. I know to count the number of unique folderIDs I do: select count (folderid) from folder …

  8. Contar registros iguais com SELECT DISTINCT e COUNT

    3 Busquei a mesma ajuda e essa foi uma solução que funcionou. SELECT DISTINCT campo1 ,campo2 ,campo3 ,campo4 ,campo5 ,campo6 ,campo7 ,COUNT(*) AS quantidade FROM …

  9. Using DISTINCT and COUNT together in a MySQL Query

    Jun 16, 2009 · SELECTING DISTINCT PRODUCT AND DISPLAY COUNT PER PRODUCT for another answer about this type of question, this is my way of getting the count of product …

  10. sql - How to Count Distinct on Case When? - Stack Overflow

    Mar 15, 2019 · COUNT(DISTINCT CASE WHEN SopOrder_0.SooParentOrderReference LIKE 'INT%' THEN SopOrder_0.SooParentOrderReference END) AS num_int You don't specify the …