Hi All,

I have a table which holds the values like shown below

ID   Col-1   Col-2   Col-3    FID
1    Good     Yes     Easy     101
2    Bad      Yes     Hard     101
3    Good     Yes     Medium   101
4    Good     No      Medium   101
5    Good     No      Medium   101

I want to have a query which gives how many "Good", "Bad", "Yes","No", "Easy".. "Medium"
values are there for FID = 101

I want to show some thing on the page like

4 persons say "Good", 1 person say "Bad"
3 persons say "Yes", 2 person say "No"
1 person say "Easy", 1 person say "Hard" and 3 persons say "Medium"

Please help me how i can query the database.

Thanks

Do this for each column, either with a union all or in separate queries

Select [col-1],count(*) from tablename -- replace with your table
where FID ='101' 
group by [col-1]
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.