|
Posted by Ray on 09/09/07 14:31
Hello,
I have a table that contains multiple prices for multiple
location (yes I know is should have been done with an Xref table or
something, but I didn't create it and it's too late to do right now).
The records are similar to this...
priceID, productID (non-unique), productName, locationID, price
1,100, prod1, 1, $3.00
2,101, prod2, 1, $4.00
3,102, prod3, 1, $2.00
4,101, prod1, 2, $9.00
5,102, prod2, 2, $5.00
6,103, prod3, 2, $8.00
What I would like is for the output is
location1Name, Product1Price, Product2Price, Product3Price
location2Name, Product1Price, Product2Price, Product3Price
location3Name, Product1Price, Product2Price, Product3Price
I have already written the proc so that if prices aren't found for a
product at a particular location it will return null records. The part
I can't figure out is how to retrieve the records in the format that I
have shown above. I've got about 6+ hours in on this and haven't found
anything helpful enough on google or Books online yet so if someone
can help I will be very thankful.
Navigation:
[Reply to this message]
|