Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Denormalize query

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-08-12 : 23:52:38
Robert writes "I have two tables with a one to many relationship. If I do a simple select and join the tables, of course I get many rows returned. How can I create a stored procedure that will return the same information but in one "denormalized" row that has the data displayed in additional columns.
Example:

Original result set: "row1col1=a, row1col2=b, row2col1=c, row2col2=d"

Desired result set: "row1col1=a, row1col2=b, row1col3=c, row1col4=d"

Using Sql Server 7.0

Thanks!"
   

- Advertisement -