Skip site navigation (1) Skip section navigation (2)

counting distinct result of join

From: Oleg Bartunov <oleg(at)sai(dot)msu(dot)su>
To: pgsql-hackers(at)postgreSQL(dot)org
Cc: pgsql-sql(at)postgreSQL(dot)org
Subject: counting distinct result of join
Date: 2000-04-04 19:35:35
Message-ID: Pine.GSO.3.96.SK.1000404222531.13408S-100000@ra (view raw, whole thread or download thread mbox)
Lists: pgsql-hackerspgsql-sql

are there an efficient way to count distinct result from join ?
I know it's possible in 7.0 to do 

select count(distinct m.msg_id) from messages m, message_section_map ms
where m.msg_id = ms.msg_id;

but I need it working in production for 6.5.3
I'd like not to use temp tables as I dont' have any experience
with them in production.



Oleg Bartunov, sci.researcher, hostmaster of AstroNet,
Sternberg Astronomical Institute, Moscow University (Russia)
Internet: oleg(at)sai(dot)msu(dot)su,
phone: +007(095)939-16-83, +007(095)939-23-83

pgsql-hackers by date

Next:From: Tom LaneDate: 2000-04-04 19:59:32
Subject: Re: CURSOR after hitting end
Previous:From: Bruce MomjianDate: 2000-04-04 19:28:06
Subject: Removed from FETCH manual page

pgsql-sql by date

Next:From: Drozdowski, Catharine IDate: 2000-04-04 23:19:56
Subject: Foreign Key Implementation
Previous:From: tjk@tksoft.comDate: 2000-04-04 14:20:32
Subject: Re: Prob in installing DBD::Pg 0.93

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group