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!

SQL Distinct records

Status
Not open for further replies.
Apr 27, 1999
705
US
Hello,

I am trying to total the number of distinct records in a table. For example, I have a field called ActionType and there are about 30 records. I can query "SELECT Distinct ActionType from TableA", this produces about six distinct types. But I actually want to find out how many of records of each distinct type I have.

Any ideas?

Your help is greatly appreciated.
Thanks,
fengshui1998
 
Try:

Select ActionType, Count(ActionType) As OnHand FROM TableA
Group By ActionType, Order By ActionType
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top