About 41,600,000 results
Open links in new tab
  1. How to count occurrences of a column value efficiently in SQL?

    I have a table of students: id | age -------- 0 | 25 1 | 25 2 | 23 I want to query for all students, and an additional column that counts how many students are of the same age: id | age | coun...

  2. sql - Count the total records containing specific values - Stack Overflow

    type // contains 2 different values: "Raid" and "Hold" authorization // contains 2 different values: "Accepted" or "Denied" I need to make a view that returns values like this: TYPE:RAID ACCEPTED:5 DENIED:7 Basically I want to know how many of the values in TYPE are "Raid" and then how many of them are "Accepted" and "Denied".

  3. SQL COUNT () Function - W3Schools

    The SQL COUNT () Function The COUNT() function returns the number of rows that matches a specified criterion.

  4. SQL SERVER – Count Occurrences of a Specific Value in a Column

    Jun 12, 2023 · Counting the number of occurrences of a specific value in a column is a common requirement in SQL Server. You can easily retrieve the desired information by leveraging the …

  5. SQL COUNT Code Examples - MSSQLTips.com

    Oct 25, 2021 · The SQL COUNT function is an aggregate function that returns the number of rows in a specified table. By default, the COUNT function uses the ALL keyword unless you specify a particular parameter value.

  6. Number of times a particular character appears in a string

    Mar 20, 2012 · Be advised the code solution for multi-char strings returns +1 when the sought after characters are at the end of the string. For example: set @myvar = 'lo Hello World, Hello …

  7. How to Use COUNT() with GROUP BY: 5 Practical Examples

    Jun 29, 2023 · Using the COUNT () function with GROUP BY is one of the most common SQL constructs in aggregate queries. Read this article to find out how to use COUNT () with GROUP BY correctly using 5 examples.

  8. SQL COUNT () function - w3resource

    Jan 14, 2025 · This SQL query retrieves customer codes (cust_code) and counts the number of orders associated with each customer from the orders table. It groups the results by cust_code and uses the HAVING clause to filter and include only those customers who have more than 3 …

  9. How to COUNT DISTINCT in SQL (with Examples) - FavTutor

    Jan 15, 2024 · Unlike regular counting, which counts everything, COUNT (DISTINCT) helps us figure out how many different things there are in a specific column of our data. It is a bit like going through a list of colors and wanting to know how many distinct colors you have without counting the same color twice.

  10. SQL Query to Count the Number of Rows in a Table

    Dec 23, 2024 · We can use the HAVING clause in the SQL query to specify a condition for the COUNT function and also we can modify the code to only show the results for num_rows where the count is greater than 1.

  11. Some results have been removed
Refresh