I am using the COUNT function in SQL. I am getting it to display the total number of occurrences specified in my criteria. However, I would like for it to display it to show the record in the field for each count. Any suggestions?
COUNT function in SQL
Collapse
X
-
Tags: None
-
-
select count (distinct field name)
from table
where field name='X'
The results yield
Distinct field name
Count=11
I want it to show each of those 11 unique counts and all the records assoicated with them. That make more sense?Comment
-
Not really. Maybe you mean the following statement (without the count?)
I don't think so, but you want to see all 11 records, so this will show them.Code:select * from table where fieldname='X'
Ronald :cool:Comment
-
Yeah that is pretty close...i just want to get the record that its couting displayed. Say if your table had a 11 different kinds of shoes but shoe A. may be in there 20 times. I would want it to display:
Shoe A: 10
Shoe B: 5
Shoe C: 8
etc... for all 11 of the records it counted.
Any help?Comment
-
Comment
Comment