Stephan, Joseph,
> Because d.id was guaranteed to be unique, you might be able to
> count(distinct d.id) and get the result you want. [I think the
> subquery is a nicer way of representing it]
Plus a several SQL implementations don't implement the DISTINCT until
after the COUNT, reuslting in a still-inflated (and sometimes varying!)
COUNT. It won't work properly in T-SQL or MS Office SQL, for example.
-Josh Berkus
______AGLIO DATABASE SOLUTIONS___________________________ Josh Berkus Complete
informationtechnology josh@agliodbs.com and data management solutions (415) 565-7293 for law firms, small
businesses fax 621-2533 and non-profit organizations. San Francisco