From: | <terry(at)ashtonwoodshomes(dot)com> |
---|---|
To: | "'Matt Chatterley'" <zen31329(at)zen(dot)co(dot)uk> |
Cc: | <pgsql-sql(at)postgresql(dot)org> |
Subject: | Re: Trying to make efficient "all vendors who can provide all items" |
Date: | 2004-03-09 13:37:48 |
Message-ID: | 042301c405db$b63c5340$2766f30a@development.greatgulfhomes.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
Of all the proposed solutions, this appears to run the fastest, and not
require the creation of an additional table.
Thanks!
Terry Fielder
Manager Software Development and Deployment
Great Gulf Homes / Ashton Woods Homes
terry(at)greatgulfhomes(dot)com
Fax: (416) 441-9085
> -----Original Message-----
> From: pgsql-sql-owner(at)postgresql(dot)org
> [mailto:pgsql-sql-owner(at)postgresql(dot)org]On Behalf Of Matt Chatterley
> Sent: Monday, March 08, 2004 3:41 PM
> To: terry(at)ashtonwoodshomes(dot)com
> Cc: pgsql-sql(at)postgresql(dot)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
>
From | Date | Subject | |
---|---|---|---|
Next Message | ow | 2004-03-09 13:50:21 | currval() without specifying the sequence name |
Previous Message | Daniel Henrique Alves Lima | 2004-03-09 13:14:44 | Re: Help to simplify sample query |