Advertisement

06.24.2008 at 10:53AM PDT, ID: 23511916
[x]
Attachment Details

SQL - combine multiple fields in same row into new table/column

Asked by dxhahn in MS SQL Server, SQL Query Syntax

Tags: SQL, Firefox 3

Greetings,
I have a situation where I am sent a database dump from another company. I'll simplify the structure:

item, desc, qty, cost, mfg_item1, mfg_item2,mfg_item3

The problem is, I need to cross reference this data against our own database, which uses the mfg_item as the primary key so ideally I need a way to transform the table they send me into a strucutre like this:

mfg_item, item, qty, cost

so that a new row is created for each instance of mfg_item from the old table and the item, desc, qty, cost and filled in for each new row that is added.

Any suggestions on how I can pull this off?

Regards.Start Free Trial
 
Loading Advertisement...
 
[+][-]06.24.2008 at 11:17AM PDT, ID: 21858604

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: MS SQL Server, SQL Query Syntax
Tags: SQL, Firefox 3
Sign Up Now!
Solution Provided By: GreenGhost
Participating Experts: 2
Solution Grade: A
 
 
[+][-]06.24.2008 at 11:39AM PDT, ID: 21858881

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628