pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: terry@ashtonwoodshomes.com
To: 'Matt Chatterley' <zen31329@zen.co.uk>
Cc: pgsql-sql@postgresql.org
Subject: Re: Trying to make efficient "all vendors who can provide all items"
Date: Mon, 8 Mar 2004 15:45:20 -0500
Message-ID: <012f01c4054e$45dfcf60$2766f30a@development.greatgulfhomes.com> (raw)
In-Reply-To: <Zen-1B0RXT-0003jc-3j@heisenberg.zen.co.uk>

That's pretty nifty code.  It certainly looks nicer, and looks like it would
work providing vendor_id&item_id is the pk of item_vendors (and it is).  I
will let you know if it runs any faster...

Thanks

Terry Fielder
Manager Software Development and Deployment
Great Gulf Homes / Ashton Woods Homes
terry@greatgulfhomes.com
Fax: (416) 441-9085


> -----Original Message-----
> From: Matt Chatterley [mailto:zen31329@zen.co.uk]
> Sent: Monday, March 08, 2004 3:41 PM
> To: terry@ashtonwoodshomes.com
> Cc: pgsql-sql@postgresql.org
> Subject: RE: [SQL] Trying to make efficient "all vendors who
> can provide
> all items"
>
>
> Hmm. My PGSQL knowledge is rusty, so this may be slightly
> microsoftified..
>
> How about just:
>
> SELECT V.VendorID, V.VendorName, COUNT(IV.ItemID)
> FROM Vendor V
> INNER JOIN Item_Vendor IV ON IV.VendorID = V.VendorID AND
> IV.ItemID IN (1,
> 2, 3, 4, 5)
> GROUP BY V.VendorID, V.VendorName
> HAVING COUNT(IV.ItemID) = 5
>




view thread (7+ messages)  latest in thread

Message-ID: <012f01c4054e$45dfcf60$2766f30a@development.greatgulfhomes.com>
Permalink:  ../012f01c4054e$45dfcf60$2766f30a@development.greatgulfhomes.com/
Also on:    postgresql.org/message-id/012f01c4054e$45dfcf60$2766f30a@development.greatgulfhomes.com

 · 

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: terry@ashtonwoodshomes.com, zen31329@zen.co.uk
  Subject: Re: Trying to make efficient "all vendors who can provide all items"
  In-Reply-To: <012f01c4054e$45dfcf60$2766f30a@development.greatgulfhomes.com>

* 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