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 > Appending info into a column

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-23-03, 09:16
Solius Solius is offline
Registered User
 
Join Date: Dec 2003
Location: Philadelphia
Posts: 6
Appending info into a column

How would you go about adding info to a column.

ex. There are 3 tables where all of the information is the same except the last column. The last column contains different types.

The tables are formatted something like

Name|Phone|Coverage|AA
Name|Phone|Coverage|BB
Name|Phone|Coverage|CC

But I want to have one table that contains the info as

Name|Phone|Coverage|AA|BB|CC|

| = Column change
Reply With Quote
  #2 (permalink)  
Old 12-23-03, 11:16
andrewst andrewst is offline
Moderator.
 
Join Date: Sep 2002
Location: UK
Posts: 5,171
Re: Appending info into a column

Join (possibly outer join) the 3 tables on the common columns.
__________________
Tony Andrews
http://tinyurl.com/tonyandrews
Reply With Quote
  #3 (permalink)  
Old 12-23-03, 11:54
edwinjames edwinjames is offline
Registered User
 
Join Date: Dec 2003
Posts: 74
Name|Phone|Coverage|AA|BB|CC|


But are you not going to have a record for each type here also?
Reply With Quote
  #4 (permalink)  
Old 12-23-03, 11:55
Solius Solius is offline
Registered User
 
Join Date: Dec 2003
Location: Philadelphia
Posts: 6
Re: Appending info into a column

I am not even sure how to word this. I tried the join and made sure to connect all of the tables to the most important information. Then I only output the AA, BB, CC columns. So in essence I have 3 free standing columns that are based on the same ID.

Here comes the problem. How do I match these columns with their related row.

I would like to take these 3 columns and append them to the end of the row with the corresponding information.

ex. I have AA|BB|CC and have Name|Number|Date

and want to have Name|Number|Date|AA|BB|CC

(the original rows looked something like my original post description)

but not all rows that had a BB correspond to a row with AA and would I want them to end up looking like this

ex. Name|Number|Date| |BB|CC

I know this is confusing, but I think it is coherent.

Please help!

Quote:
Originally posted by andrewst
Join (possibly outer join) the 3 tables on the common columns.
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