Top "Count" questions

Count refers to the number of objects in a collection.

SUM of grouped COUNT in SQL Query

I have a table with 2 fields: ID Name -- ------- 1 Alpha 2 Beta 3 Beta 4 Beta 5 Charlie 6 Charlie I want to group …

sql count sum
How do you find the row count for all your tables in Postgres

I'm looking for a way to find the row count for all my tables in Postgres. I know I can …

postgresql count database-table
How to count instances of character in SQL Column

I have an sql column that is a string of 100 'Y' or 'N' characters. For example: YYNYNYYNNNYYNY... What is the …

sql string tsql count symbols
Laravel Eloquent - distinct() and count() not working properly together

So I'm trying to get the number of distinct pids on a query, but the returned value is wrong. This …

laravel count eloquent distinct
Count number of records returned by group by

How do I count the number of records returned by a group by query, For eg: select count(*) from temptable …

sql-server tsql count group-by
MySQL - Using COUNT(*) in the WHERE clause

I am trying to accomplish the following in MySQL (see pseudo code) SELECT DISTINCT gid FROM `gd` WHERE COUNT(*) > 10 …

mysql count aggregation having
SQL: How to get the count of each distinct value in a column?

I have a SQL table called "posts" that looks like this: id | category ----------------------- 1 | 3 2 | 1 3 | 4 4 | 2 5 | 1 6 | 1 7 | 2 Each category number corresponds to a …

mysql sql count
Count number of objects in list

R function that will return the number of items in a list?

list r count
How do we count rows using older versions of Hibernate (~2009)?

For example, if we have a table Books, how would we count total number of book records with hibernate?

java hibernate count
How to count the number of true elements in a NumPy bool array

I have a NumPy array 'boolarr' of boolean type. I want to count the number of elements whose values are …

python arrays numpy count boolean