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
 General SQL Server Forums
 New to SQL Server Programming
 Merging 2 rows on same table

Author  Topic 

anthcott
Starting Member

1 Post

Posted - 2011-06-17 : 11:32:59
Can you please show me a simple way to merge two rows that have similar columns? Eg: consider merging the following table based on Author and Title.
ORIGINAL TABLE:
BOOK TITLE --------AUTHOR-------EDITION
All about Dogs-----Peter--------Standard
All about Cats-----Jack --------International
All about Cats-----Jack --------Standard
All about Rats-----Jack --------Standard
All about Bats-----Jane --------International

DESIRED FORMAT:
BOOK TITLE---------AUTHOR-------EDITION
All about Dogs-----Peter--------Standard
All about Cats-----Jack --------International, Standard
All about Rats-----Jack --------Standard
All about Bats-----Jane --------International

The point is that Books of different editions but same author and title should be in one row.

Please guide. Thank you


robvolk
Most Valuable Yak

15732 Posts

Posted - 2011-06-17 : 13:05:55
Take a look here: http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=161943
Go to Top of Page
   

- Advertisement -