Hi, I have been struggling to construct a query that identifies distinct names and count how many times each of these occurs in the the set. At the moment I do this in python, but would like to improve the queries instead.
I have two queries that identify distinct names and count the occurrences of one selected result, the struggle is to combine these two queries into one that returns both.
To count the number of times LocalOrder occurs I use the following:
select count(NAME) from Results where NAME=~ /LocalOrder/
And to identify distinct NAME’s in the measurement I use the following:
select distinct(NAME) from Results
My question is how could a single query that returns all distinct names and the number of times they occur be constructed with the help of subsets?