![]() |
|
![]() | ||
|
Subject:
database concepts
Category: Computers > Software Asked by: fahd-ga List Price: $6.00 |
Posted:
26 Sep 2002 20:24 PDT
Expires: 26 Oct 2002 20:24 PDT Question ID: 69565 |
Complete the following problem using basic SQL commands. Basic SQL means not specifically tied to TSQL, SQL PL or DB 2 Versions. if I am given a table with the addresses of consumers to whom we wish to send junk mail. The table has a fam(family) column that links Consumers with the same street address. We need this because our rules are that we mail only one offer to a household. The field contains the PK value of the Consumers record of the first person who had this address, thus: Consumers Name address id fam Bob A 1 Null Joe B 3 Null Mark C 5 Null Mary A 2 1 Vickie B 4 3 Wayne D 6 null We need to delete those rows where fam is null but there are other family members on the mailing list. How would you do it in SQL? | |
| |
|
![]() | ||
|
There is no answer at this time. |
![]() | ||
|
Subject:
Re: database concepts
From: googlymoogly-ga on 30 Oct 2002 04:27 PST |
I'm not sure why you would want to "delete those rows where fam is null but there are other family members on the mailing list." but his should do what you asked: delete from consumers c1 where c1.fam is null and exists (select c2.fam from consumers c2 where c1.id = c2.fam); |
If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you. |
Search Google Answers for |
Google Home - Answers FAQ - Terms of Service - Privacy Policy |