flyingsquirel
asked on
SQL Break single rows into multiple rows
Hi,
This should be a pretty simple task for a SQL guru. Its just a little complicated for me with the nesting.
I have a table consisting of the data I need to populate another table. However in the target table the data needs to be split into multiple rows per "item" which has a unique identifier.
I need a query that will basically take each column of the source table row and add it to a separate row in the TARGET table. I have set up a few rows of each below.The data in the TARGET table is always the same for each item id. So the query needs to create the SET of rows for EACH of the line items in the SOURCE table.
This should be a pretty simple task for a SQL guru. Its just a little complicated for me with the nesting.
I have a table consisting of the data I need to populate another table. However in the target table the data needs to be split into multiple rows per "item" which has a unique identifier.
I need a query that will basically take each column of the source table row and add it to a separate row in the TARGET table. I have set up a few rows of each below.The data in the TARGET table is always the same for each item id. So the query needs to create the SET of rows for EACH of the line items in the SOURCE table.
SOURCE:
[ID] [service] [time] [price]
59 Golden 30 45.00
60 Sparkle 30 45.00
TARGET
[id] AllowCancellations True
[id] AllowRescheduling True
[id] AppointmentDuration [time]
[id] AppointmentDurationMax [time]
[id] AppointmentInterval [time]
[id] CancellationFee 0.00
[id] DaysAhead 30
[id] MaxAppointments 4
[id] MinTimeAhead 00:00:00
[id] ReschedulingFee 0.00
[id] SchedulingFee [Price]
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER