21,725 questions
Advice
1
vote
4
replies
195
views
How can I show only the first instance of a SQL count?
In SQL Server, I have table myTable with fields patientID, orderID, and orderDesc. patients can have multiple orders with individually variable descriptions.
I’m requested to write a query to select ...
Score of 0
0 answers
72 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 ...
Score of -4
3 answers
192 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]
...
Score of -2
3 answers
151 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 ...
Score of 1
4 answers
270 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 ...
Score of 0
1 answer
86 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, ...
Score of 2
2 answers
123 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.
...
Score of 3
3 answers
194 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 ...
Score of 0
0 answers
76 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 ...
Score of 2
3 answers
159 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 ...
Score of 0
2 answers
138 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 ...
Score of 1
1 answer
147 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 ...
Score of 0
0 answers
78 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 ...
Score of -1
2 answers
80 views
Unique Values Count
I have a small list of employees, and how much units they finished a given day. But I have duplicate values, because they have to place multiple components. List looks something like this:
Employee
...
Score of 0
0 answers
21 views
Count tinyint columns with specific value [duplicate]
I have table with tinyint and I want to count positive and negative values.
I tried the following example (simplified) but the results are wrong. There are 4 (1) in table so I expect like_count to be ...