I really hate when people post questions without trying to do their own homework first. That's why I resisted two months ago before posting, now I have given up.
I have a family tree system that contains a table that looks like this:
_________________________________________
¦ I D ¦ Person ¦ Mother ¦ Father ¦
I would like to find the total number of unique names in this table.
This table contains a couple hundread rows, any ideas?
count(id) will count all rows.
count(father) will count all rows with father that are not NULL
Try to avoid count(*) because * is not indexed.
[edited by: Lisa at 12:19 am (utc) on Nov. 27, 2002]
Try to avoid count(*) because * is not indexed.
With which databases are count(*) a performance problem. It seems to me that any database should be able to come up with the count of records in a query real fast, and probably faster than if it had to actually look at a field to see if it is NULL.
I have always learned that count(*) is the faster!
René.