Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL Query
Just try this :
select product_id from the_table
group by product_id
HAVING COUNT(*) = 2;
Pierre
Mads Kristiansen a écrit :
> Hi,
>
> How would one best do the following in SQL:
>
> I have a table like this:
>
> id product_id service_id
> 1 10 3
> 2 11 3
> 3 11 5
> 4 12 5
> 5 13 5
> .
> .
> .
>
> Product 11 has 2 services as you can see. How could I identify all other
> products in that table with the same exact two services. Not more or not
> less services...
>
> - Mads
Received on Tue Nov 09 1999 - 06:55:15 CST
![]() |
![]() |