Results 1 to 4 of 4
Thread: Count unique records
Dec 31, 2010, 04:41 #1
Count unique records
I have a table where each row contains a boolean and a foreign key to another trecord in another table.
I want to know how many distinct foreign keys have false as the boolean - something like this:
SELECT COUNT( SELECT DISTINCT Table.RecordID FROM Table WHERE Table.Bool = 0) AS UniqueRecordCount
monkeymonkey - the rest is history
Dec 31, 2010, 04:45 #2Code:
SELECT COUNT(DISTINCT Table.RecordID) AS UniqueRecordCount FROM Table WHERE Table.Bool = 0
Dec 31, 2010, 04:53 #3
Dec 31, 2010, 04:55 #4
Don't kick too hard... there's a party tonight!