Saturday, December 27, 2014

SQL Query - Multiple records from value of field

I have a table that has the following lay out






















ID



AreaUnitServes



Filter1Quantity



Filter1Size



Filter2Quantity



Filter2Size



And I’m trying to convert it to
















FkPSAUnitsID



Size



Location



I’ve got the following query started but I’m stuck on how to INSERT INTO multiple records by the value of Filter1Quantity. I also have to query for Filter2Quantity.


INSERTINTO RapidServ.dbo.PSAFilters


(FkPSAUnitsID,Size,Location)



SELECT ID AS FkPSAUnitsID,Filter1Size AS Size,


AreaUnitServes AS Location



FROM RapidServ.dbo.PSA



Thanks,




why767


No comments:

Post a Comment