I have a question I want to query a datamart with transactional data. I have 3 fields the unique one is the product. I want to get a query where i set a number from the range of how many unique item there is on field three against field 1 & 2.

I'm not sure if explained it clearly...I attached some snap shot through excel on how I want my output to be.

Thanks in advance.

You should use count,

SELECT A,B,C,COUNT(C) 
   from TABLENAME
   GROUP BY A,B,C
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.