New count() question - Mailing list pgsql-sql

From Mitch Vincent
Subject New count() question
Date
Msg-id 014d01bf4a4e$a41e0ac0$0300000a@doot.org
Whole thread Raw
In response to Re: [SQL] count() question  (Oleg Bartunov <oleg@sai.msu.su>)
Responses Re: [SQL] New count() question  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-sql
Ok, so it's two queries. I have another intersting problem though.. Example
of one of my count queries :

select count (*) as total from applicants as a,applicants_states as
s,resume_search as re where a.app_id=s.app_id and a.app_id=re.app_id and
re.user_id=291

That's all well and fine except that it only counts the total from the
applicants table, not the total from the rest of the query.

I know I'm just not doing something right (obviously), can someone lend a
hand?

I've played with grouping but can't seem to get the syntax all right.

Thanks (again)!

-Mitch





pgsql-sql by date:

Previous
From: Oleg Bartunov
Date:
Subject: Re: [SQL] count() question
Next
From: "Alain TESIO"
Date:
Subject: Re: [SQL] group by / having