Select from table where data row missing

0 pts.
Tags:
OUTER JOIN statement
SELECT statement
I have a table with the main fields being BU, ASSET, BOOK for any BU and ASSET combination, there should be two to four rows of data, with just the BOOK value being different. Data corruption has caused us to find all BU-ASSET combinations missing the value 'AMT' for BOOK. I need to join the table to itself (I think) to do this, but my repeated efforts have failed. If I have BU = 10 and ASSET = 125, I have four rows, with BOOK = 'FED','CORP','AMT','LOCAL' and for BU = 20 and ASSET = 130, I have rows with BOOK = 'CORP','FED'. I want to identify BU/ASSET 20/130 as needing an 'AMT' row but to skip BU/ASSET 10/125 since it has an 'AMT' row. How do I accomplish this?
ASKED: October 15, 2007  9:34 PM
UPDATED: October 25, 2007  1:08 PM

Answer Wiki

Thanks. We'll let you know when a new response is added.

I meant to say Data Corruption has necessitated that we find the above scenario.

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Micah5
    I think this would work: insert into TABLE select distinct bu,asset,'AMT' from table minus select bu,asset,book from table
    0 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following