View Single Post

  #1 (permalink)  
Old 03-05-2008
canoe414@telecom-digest.zzn.com
 
Posts: n/a
Default consolidation of multiple rows

Greetings all,

I've got a table raw_Companies
--nname
--address
--phone
--fax
--email
--homepage

with no keys defined
and a table Companies
with the same structure but with nname declared as a primary key.

Once raw_Companies gets loaded up I see where there are multiple rows
with the same value for nname but missing data in the other fields.
One row may have an address and phone while another will have only an
email, while a third may have an address and a homepage.

I need a way to take the rows in raw_Companies with the same nname and
consolidate them into one composite row inserted into Companies.

So from

IBM----1234 Main Street,Rochester,NY----\N----\N----sales@ibm.com----
www.ibm.com
IBM----\N----212-745-9324----212-745-0158----\N----\N

in raw_Companies to

IBM----1234 Main
Street,Rochester,NY----212-745-9324----212-745-0158----
sales@ibm.com----www.ibm.com

in Companies

Any help/hints/suggestions/code would be greatly appreciated.

TIA,

Still-learning Steve
Reply With Quote