I have a table:
Id Catg 1 cat01 2 cat01 3 cat01 1 cat02 2 cat02
now I want to detect number of occurance of catg01 and catg02,like in this ex, catg01 is 3 times and catg02 is 2 times,I want to count that through LINQ/ simple db query. Pls note: cant use Where clause and hardcode Catg01/catg 02,as there can n number of category.Is it possible to detect? if yes then pls help.
For the LINQ Version. Imagine a Class
Then if you had a list of that class, you could query it as follows