Let's say I have a table named details
with these columns:
product id = int
product price = float
products' category = nvarchar(50)
This table has no primary key (or foreign key, if that's matter).
I want to perform a query which returns a list of strings which contains the 10 most frequent product's category (the categories with the most products belong to), in descending order.
How can I perform this query?
You could try something like this:
where I assume that
products
is your data context class.