nandakrishnacherukuri
SSC Enthusiast
Points: 151
More actions
February 3, 2011 at 4:00 am
#234390
CREATE table AD(sno int,sname varchar(20))
insert into ad values(1,'a')
insert into ad values(3,'c')
insert into ad values(2,'b')
select * from ad
o/p:
1,2,3
srikant maurya
Hall of Fame
Points: 3293
February 3, 2011 at 4:24 am
#1281811
Below sql may help you ...
SELECT SUBSTRING(result,1,LEN(result)-1) AS [O/P]
FROM (SELECT LTRIM(SNO) + ','
FROM #ad
FOR XML PATH(''))T ( result )
Good luck
February 3, 2011 at 4:34 am
#1281814
thank u
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply