pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruno Wolff III <bruno@wolff.to>
To: InterZone <lists@interzone.gr>
Cc: pgsql-sql@postgresql.org
Subject: Re: Optimal query suggestion needed
Date: Thu, 17 Jun 2004 15:01:23 -0500
Message-ID: <20040617200123.GA28736@wolff.to> (raw)
In-Reply-To: <40D1EF7A.1040302@interzone.gr>
References: <40D1AEB0.1010604@interzone.gr>
	<20040617175422.GA7171@wolff.to>
	<40D1EF7A.1040302@interzone.gr>

On Thu, Jun 17, 2004 at 22:22:34 +0300,
  InterZone <lists@interzone.gr> wrote:
> 
> Thanks
> the query you sent failed on v. 7.4, so I added an "end" to the case 
> statement. I selected from the tables and the results seem to be correct.

That was an unintentional typo.

> 
> I rewrite it for archiving reasons:
> 
> select t0.code, t0.address, t0.mun, t1.code as t1code, t1.pname
> count(t2.code) as t2total, count(case when t2.avail then 1 else NULL 
> end) as t2avail from t0, t1, t2 where t2.t0_fk = t0.code and 
> t2.t1_fk=t1.code group by t0.code, t0.address, t0.mun, t1.code, t1.pname
> 
> 
> Once again thank you.

Your welcome.



view thread (6+ messages)

Message-ID: <20040617200123.GA28736@wolff.to>
Permalink:  ../20040617200123.GA28736@wolff.to/
Also on:    postgresql.org/message-id/20040617200123.GA28736@wolff.to

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: bruno@wolff.to, lists@interzone.gr
  Subject: Re: Optimal query suggestion needed
  In-Reply-To: <20040617200123.GA28736@wolff.to>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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