We take pride in your success. We let our positivity drive us, day in and out. Talk to us at Mindfire to know us more.

Software Technology Tips

The following approach can be helpful while showing multiple columns(',' seperated) in a single row of a grid for a particular value.
 
SELECT Column1,Column1,
--Column for which you need ',' seperated values
State = substring(EL.ORDER_list, 1, datalength(EL.ORDER_list)/2 - 1)
from Table1 c
cross apply
(select state + ',' as [text()]
from Table2
where Condition
FOR XML PATH(''))
EL(ORDER_list)
 
 
Output
                    
Column1 Column2    State
'value1'   Value2  

state1,state2,state2

 


Related Tags:

Database, SQL Server

Author: Manish Tiwari

top

Database

Let us Connect!

privacy

copyright (c) Mindfire Solutions 2007-2012. Login