If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ANSI SQL > Difficult SQL

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-20-04, 10:31
elisabeth elisabeth is offline
Registered User
 
Join Date: Jul 2003
Location: England
Posts: 26
Difficult SQL

Hello,

Please can anyone help?

I have got two tables, accounts and account customers.

The accounts table has more than one row for each account, identified by the account number and the sub account.

Each customer should be linked to all of the sub accounts for their account (in the account customers table).

I have found some accounts where one customer might be linked to all the sub accounts but the 2nd customer on the account is only linked to one of the sub accounts. This is wrong & needs to be corrected.

Please can anyone advise how I go about selecting all of the problem accounts.

To start with I grouped all the existing links together, I then need to somehow check each account against this main list.

Please can you advise.

Thanks,
Beth
__________________
Beth
Reply With Quote
  #2 (permalink)  
Old 07-20-04, 10:50
LKBrwn_DBA LKBrwn_DBA is offline
Registered User
 
Join Date: Jun 2003
Location: West Palm Beach, FL
Posts: 2,455
Wink

Beth, describe the tables and give sample data.
__________________
The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On