21,735 questions
-11
votes
0
answers
114
views
how to improve performance COUNT distinct from 13.6 million rows scanned [closed]
13.6 million rows being scanned for COUNT(DISTINCT quiz_analytic_id). This is the real issue. COUNT(DISTINCT ...) is expensive because MySQL cannot use index statistics to shortcut it
-2
votes
0
answers
66
views
Why does COUNT(*) return a different result than COUNT(column_name) in a LEFT JOIN query? [duplicate]
I am trying to count how many orders each customer has. I noticed that COUNT(*) and COUNT(o.order_id) return different results and I don’t fully understand why.
Here is a simplified example:
CREATE ...
0
votes
0
answers
62
views
DAX Minimum of a count within a Group
I have a dataset with dates and hours and a count of the number of events within each hour. I want a measure to take the minimum value of the count within each hour.
So the min count by hour column ...
-4
votes
3
answers
180
views
Returning multiple columns and count of duplicates with GROUP BY clause
I'm searching for duplicate values per column and need a count of them and data from some additional columns.
Table sample
BillNr
Name
email
1000
Shakira
[email protected]
1001
Shakira
[email protected]
...
-2
votes
3
answers
136
views
make a list according to max count [duplicate]
I have a list
my_list = [3,8,11,8,3,2,1,2,3,3,2] # my list
max(my_list, key=my_list.count) # most frequent number appeared on the list
But i want to make a list according to the most frequent ...
1
vote
4
answers
248
views
Count columns until the value changes
I have a table that has values for each week in each column. I want to count the number of consistent values starting from the first week until it changes. I've tried searching for answers but I ...
0
votes
1
answer
69
views
MySQL Aurora slow COUNT query
I have a COUNT(*) query that is really fast in several DB's, but is really slow on MySQL AURORA:
I can't seem to figure out why. First I thought it was because it went the MEMORY went over the 4MB, ...
2
votes
2
answers
118
views
Invalid identifier when using aggregate count(*) [duplicate]
I need to count the number of students who were registered in a given course over an academic year.
The following SELECT query returns a column of course numbers and a column of the academic year.
...
3
votes
3
answers
185
views
Reduce nested IF…ELSE conditions that iteratively condition building a query by adding filters one by one
My stored procedure has this structure:
if Count 1>0 then
count 2 with (condition 1,)
if Count 2>0 then
count 3 with (condition 1,2)
if Count 3>0 then
count 4 with(condition ...
0
votes
0
answers
68
views
Database or data structure for fast exact counting
In databases such as PostgreSQL, doing exact counts like select count (*) from table where condition perform a full table scan.
PostgreSQL will need to scan either the entire table or the entirety
of ...
2
votes
3
answers
141
views
Query count & sum nested selects into a Grouped Category
My current project/issue is we have a list of permit types. With these types they are needing to be grouped by an overall category. Once grouped out the end goal is to count how many within specified ...
0
votes
2
answers
130
views
Efficiently Count Number of Ones at Deepest Level in Recursive Floor-Ceil Splitting of Large Binary Number
I have a number represented as a large binary string (length can be up to 1 million bits). The number is recursively split as follows:
At each step, divide the number
x into two parts:
floor(x/2) and ...
1
vote
1
answer
130
views
Counting Emails in Subfolder automatically in Excel
I am trying to get a cell in excel to display a total count of emails in a given subfolder from a specific outlook account (which is a shared mailbox).
Two questions: How to specify which Outlook ...
0
votes
0
answers
28
views
Monthly Count of labels entered into a Gsheet
I can manually see the number of conversations in each label in the settings screen.
I want to pull this data monthly and automatically add the count in a Gsheet so I can see the trend over time. Can ...
0
votes
0
answers
71
views
How to aggregate by a set of columns and turn groups on columns with counts of the same dataframe in R? [duplicate]
I´ve got a large dataframe that I´ve got to aggregate and then show counts by geo, the lines should be unique by product, sex and education… already use dplyr to group by and then count but only get ...