Results 1 to 3 of 3
Feb 19, 2005, 06:58 #1
- Join Date
- Jul 2004
- 0 Post(s)
- 0 Thread(s)
Getting count of distinct merchants to products
I have the query below. To retrieve the number of merchants in the merchants table and the number of related products each merchant has.
Now when i run this query, i get the merchants in table a
2. the total number of products repeated in table b. (THE SAME FOR ALL MERCHANTS)
How do i get each distinct merchant products assigned to his name ?
something like this
SELECT a.merchants, b.products FROM (SELECT DISTINCT (merchant) merchants FROM dbo.markets_product_registration) a CROSS JOIN (SELECT COUNT(products) AS products FROM dbo.markets_products WHERE (status = 1)) b