Count by particular attribute from results

JonT shared this question 4 years ago

I am trying to use COUNT in a query, but it seem to show the results by line in increments of 15, i.e. one row will have 15, a group of rows will have 30 or 45, etc. I have tried using and not using SELECT DISTINCT, I have also tried COUNT(DISTINCT(attr)) and I either get a single 1 or I get a multiple of 15. What I would like to do is get the list of tool types and then have an aggregate count for each tool type over time. This is the query and here are a couple results. I can graph this and it looks good for the most part, but there is a request for top N tools and it would be nice if we could have it show an aggregate count of each, maybe by day.

I have tried a number of things and can't seem to get it to do what I want. This is a freehand SQL query, but I didn't see how to get the data through the builder.

EDIT: I was able to get in touch with someone within the bank who was able to help. BMC had no suggestions (to date) and while it may have been possible to do what this freehand query does in the UI, it was not terribly obvious either way. Attaching the query in event someone else can benefit from it.



Replies (0)

Leave a Comment
Attach a file