pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tomasz Myrta <jasiek@klaster.net>
To: Stephan Szabo <sszabo@megazone23.bigpanda.com>
To: Tomasz Myrta <jasiek@klaster.net>
Cc: pgsql-sql@postgresql.org
Subject: Re: sub-select with aggregate
Date: Thu, 24 Oct 2002 08:19:51 +0900
Message-ID: <20021024081951.M77126@klaster.net> (raw)
In-Reply-To: <20021023082355.G5481-100000@megazone23.bigpanda.com>
References: <20021023081036.M5349-100000@megazone23.bigpanda.com>
	<20021023082355.G5481-100000@megazone23.bigpanda.com>

> The other forms only move the filtering clauses around.  There's 
> still only a filter on the outer group_id equaling the inner 
> group_id and a filter on group_id=3.  It's just a question of 
> whether it's:
> 
> Scan users in subselect from group_id=3, group and aggregate them
>  and join with users on subselect's group_id = users.group_id
> 
> or
> 
> Scan users for group_id=3, scan users in subselect, group and
>  aggregate them and join these two on subselect's
>  group_id=users.group_id.
> 
> The latter is effectively what your original query gave, the former
> appears to be what my two queries from a couple of mails ago gives.

I'm sorry, if you misunderstood me - I didn't show it clear.
I want to scan users for group_id=3 and then join subselect for the same 
group_id. I can't pass group_id=3 directly to subselect, because it's not a 
query but a view.

--
Tomasz Myrta <jasiek@klaster.net>




view thread (17+ messages)  latest in thread

Message-ID: <20021024081951.M77126@klaster.net>
Permalink:  ../20021024081951.M77126@klaster.net/
Also on:    postgresql.org/message-id/20021024081951.M77126@klaster.net

 · 

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: jasiek@klaster.net, sszabo@megazone23.bigpanda.com
  Subject: Re: sub-select with aggregate
  In-Reply-To: <20021024081951.M77126@klaster.net>

* 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