.Net Basic

This blogs gives introduction to C#.NET programming for beginners. This blogs assumes that you have no programming experience whatsoever. It's a lot easier than you think, and can be a very rewarding hobby!after Refer this blog

07 May 2010

Multiple rows in a single row with separator in SqlServer

Here is a simple way to make a single row value from multiple rows with a separator in SqlServer. I have a table like the following…
Table Name: People
Column name :ID,Name


Now I need the ‘Name’ column values where matching the value of ‘aaaa’ in to a single row. For this I have tried to make a query. Just use the following query to get the solution. declare @res varchar(1000) select @res = coalesce(@res + ',', '') +Name from people WHERE Name = 'aaaa' select @res

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home