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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Ignore Duplicte Entries in count 1

Status
Not open for further replies.

johnv20

Programmer
Joined
Sep 26, 2001
Messages
292
Location
US
Hi, I have a table that looks something like

Name Info
AAA BBB
AAA CCC
DDD BBB
AAA CCC

How do I count the total no. of entries in the table only ignoring those entries where both fields are duplicates of a previous one. So that the answer to the table above would be 3?
 

Select Name, Info, Count(*) As DistinctCnt
From
(Select Name, Info From Table
Group By Name, Info)
Terry L. Broadbent
FAQ183-874 contains tips for posting questions in these forums.
NOTE: Reference to the FAQ is not directed at any individual.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top