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-08 20:45:20 |
Message-ID: | 012f01c4054e$45dfcf60$2766f30a@development.greatgulfhomes.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
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(at)greatgulfhomes(dot)com
Fax: (416) 441-9085
> -----Original Message-----
> From: Matt Chatterley [mailto:zen31329(at)zen(dot)co(dot)uk]
> 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 | Christopher Browne | 2004-03-09 03:20:03 | Re: Trying to make efficient "all vendors who can provide all items" |
Previous Message | Matt Chatterley | 2004-03-08 20:40:30 | Re: Trying to make efficient "all vendors who can provide all items" |