Joseph,
SImple as pie (e.g., easy on your 100th one):
> select count(*) from d where status = 2 and d.id = u.dkey and
> u.status =
> 2 and not u.b and u.akey = a.key and a.status = 3;
Count(*) will always count the number of records in the largest table in
your join. If you want the number of records in a specific table, then
you have to make sure that that table is the only on in your FROM
clause, and reference all other tables in WHERE:
select count(*) from d
where id IN (select u.dkey from u, a where u.akey = a.key AND u.status = 2 and not u.b and a.status = 3);
-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