pg.ddx.io pgsql-sql@postgresql.org mailing list archivehelp / color / mirror / Atom feed
New count() question 2+ messages / 2 participants [nested] [flat]
* New count() question @ 1999-12-19 18:26 Mitch Vincent <mitch@venux.net> 1999-12-19 22:38 ` Re: [SQL] New count() question Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 1 reply; 2+ messages in thread From: Mitch Vincent @ 1999-12-19 18:26 UTC (permalink / raw) To: 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 ^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: [SQL] New count() question 1999-12-19 18:26 New count() question Mitch Vincent <mitch@venux.net> @ 1999-12-19 22:38 ` Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 2+ messages in thread From: Tom Lane @ 1999-12-19 22:38 UTC (permalink / raw) To: Mitch Vincent <mitch@venux.net>; +Cc: pgsql-sql "Mitch Vincent" <mitch@venux.net> writes: > 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. Er ... um ... what? The above will generate the count of the number of joined tuples satisfying the WHERE condition. There is no "rest of the query". I'm not following what you actually want to do, but evidently this isn't it. regards, tom lane ^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~1999-12-19 22:38 UTC | newest] Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 1999-12-19 18:26 New count() question Mitch Vincent <mitch@venux.net> 1999-12-19 22:38 ` Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox