Re: Correlated subqueries slow as hell?

From: Chuck Hamilton <chuckh_at_ix.netcom.com>
Date: 1996/01/03
Message-ID: <4ce66i$f86_at_cloner2.ix.netcom.com>#1/1


deangup_at_admin.ci.seattle.wa.us wrote:

>> jpanico_at_netcom.com (Joe Panico) writes:
>>
>> My question has two parts:
>>
>> 1) MYTABLE has an SSN and an ID column, among others. ID is unique,
>> SSN is not. If I want to see all the attributes for each row that
>> contains a *unique* SSN, and for those SSNs which have multiple rows
>> I don't care which row I see, how should I form the query?
>>>>>
>I wonder if this might be a data modeling problem? It sounds like you are trying to store information about
>something you identify by SSN in a table whose primary key is ID. If you are willing to create a new table
>whose primary key is SSN, and carry SSN as a foreign key in MYTABLE, this situation might improve.

I've seen similar situations in the past. The problem was that not everyone is willing to have or divulge their SSN (assuming it stands for social security number). You'd be surprised how many people are afraid of "big brother". If that's the case you need NULL SSNs which precludes it from being a PK.

--
Chuck Hamilton
chuckh_at_ix.netcom.com

Never share a foxhole with anyone braver than yourself!
Received on Wed Jan 03 1996 - 00:00:00 CET

Original text of this message