Hi
Sorry I don't quite understand.
Here is my query:
SELECT company_id, produc_id, sum(amount)
FROM purchase
WHERE customer_id = 123
GROUP BY company_id, product_id;
This is of course a simplified version of the actual query.
I execute the query and store them in my DataSet
Now, I want to get a distinct company_id, how do I do it
from ASP.NET. rather than execute the 2nd Query something like
SELECT distinct company_id
FROM purchase
WHERE customer_id = 123
Because I will need to find distinct value of other columns as well.
|