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 2005 Forums
 Transact-SQL (2005)
 Need Help

Author  Topic 

sks198117
Starting Member

46 Posts

Posted - 2007-04-12 : 11:00:35
I've a table in following format
emname city
1 a
1 b
1 c
2 a
2 b
3 a

i need the output as
1 a,b,c
2 a,b
3 a


Can any one help me
thanks in advance..

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-04-12 : 11:01:35
refer to http://sqljunkies.com/WebLog/amachanic/archive/2004/11/10/5065.aspx


KH

Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-04-12 : 11:04:42
Where do you want to show concatenated data?

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

sks198117
Starting Member

46 Posts

Posted - 2007-04-12 : 11:04:43
Is it possible without using procedure?
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-04-12 : 11:05:30
quote:
Originally posted by khtan

refer to http://sqljunkies.com/WebLog/amachanic/archive/2004/11/10/5065.aspx


KH




You are always faster

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

sks198117
Starting Member

46 Posts

Posted - 2007-04-12 : 11:05:49
i've a asp page on which i want to get formated output as mentioned above
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-04-12 : 11:07:11
See if second page of this helps you
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=76862

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-04-12 : 11:07:29
quote:
Originally posted by sks198117

Is it possible without using procedure?


Yes. the link suggest function.


KH

Go to Top of Page
   

- Advertisement -