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
 How to make duplicateRows in Single Row

Author  Topic 

learntsql

524 Posts

Posted - 2010-01-06 : 02:01:36
Hi...
I have two columns
AccountNumber and Description .
Account number may be duplicated for for different transactions
as sample data like

AccountNumber--Description--Date
100--Diposited 10K--Date1
100--Balance Check--Date1
101--Withdrawn 5K--Date1
100--Withdrawn 5K--Date2
100--Balance check--Date2
101--TPT 1K--Date2

My Output should be as in two columns
AccountNumber -- TransactionDiscription
100 -- Diposited 10K on Date1,Balance Check on Date1,Withdrawn 5K on Date2,Balance check on Date2
101 -- Withdrawn 5K on Date1,TPT 1K on Date2

in tow rows.
i.e if many transaction done on same account on same or different dates i need to combine in single row as per date ASC/DESC order.
Thanks in advance.

bklr
Master Smack Fu Yak Hacker

1693 Posts

Posted - 2010-01-06 : 02:07:05
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=81254
Go to Top of Page

learntsql

524 Posts

Posted - 2010-01-06 : 04:39:34
Thank you bklr,
that was great post.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-01-06 : 04:41:41
also given here
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=137910
Go to Top of Page
   

- Advertisement -