Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: SQL: How to see items from more than one vendor
Dave Rawding wrote:
> Given an item_vendor table with fields item, vendor, etc. how do I
> find situations where the same item is purchased from more than one
> vendor? This is not normally the case, but it does happen
> occassionally. tia.
Assuming that the combination of the columns item and vendor are unique in the item-vendor table, the following SQL will return all items with more than one vendor
select item, count(*)
from item_vendor
group by 1
having count(*) > 1;
Rudy Received on Wed Dec 15 1999 - 13:31:29 CST
![]() |
![]() |