Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Distinct Count problem 1

Status
Not open for further replies.

pacificpear

Programmer
Dec 27, 2004
25
0
0
US
Hi
I have to calulate the distinct count. I have the following table.

A B C
0801234 010 A343
0801234 010 A344
0801234 010 A344
0801234 011 A345
0801234 011 A346
0801234 011 A347
0801235 012 A348
0801235 013 A349


* Calucate the dictint count of C

Expected Result

A B Count
0801234 010 2
0801234 011 3
0801235 012 1
0801235 013 1

Can any one help
PP
 
Try this:
Code:
select      a,  
            b, 
            count(distinct c)
from        TableA
group by    a, b

Regards,
AA
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top