Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Simple SQL problem?
Ahh. The wonderful "having" clause comes into play once again...
Take a look at the Oracle docs for more details, but I think that something like the following would suit you well:
select part, count (*) from tablex group by part having count (*) > 1;
Bye,
TG
mushpencil.20.potkettle_at_spamgourmet.com wrote:
> Hi all,
>
> I'm sure there is a simple answer to this one but I simply can't
> figure it out for myself :)
>
> I have a table that contains (for example):
>
> supplier part price
> ========================
> A1 1234 1.00
> A1 4567 1.50
> A2 6543 1.75
> A2 1234 1.05
>
> I need an SQL query that will list the parts that are supplied by more
> than one supplier, in this case part 1234.
>
> I've tried to figure this out for myself but I'm getting nowhere.
>
> Thanks in advance...
>
> F.
Received on Mon May 12 2003 - 15:13:14 CDT
![]() |
![]() |