Reply to Multiple records in one row

Your name:

Reply:


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.

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация