Page 1 of 1

Desperate for SQL query help!!

Posted: Tue Oct 21, 2008 8:22 pm
by boroatel
Hello,

Can any SQL master out there help me with a query? I have the following table:

contract project activity
row1 1000 8000 10
row2 1000 8000 20
row3 1000 8001 10
row4 2000 9000 49
row5 2000 9001 49
row6 3000 9000 79
row7 3000 9000 78

Basically, the query I'm looking for would return "2000,49" for "contract, activity" because only contract #2000 has one, and ONLY one, unique activity value.

I greatly appreciate your help,

Thanks a million in advance,
boroatel

Re: Desperate for SQL query help!!

Posted: Wed Oct 22, 2008 1:30 am
by novice4eva

Code: Select all

SELECT   creditor_type, entity_type_cd
    FROM all_data_information
GROUP BY creditor_type, entity_type_cd
having count(*)=1