Hi Mohi Uddin,
what i think you want to do is like--
I have a table as table1
Date Bill_no cust_name Item_name
2/2/2013 234 ABC wireless mouse
2/3/2013 234 ABC wireless keyboard
2/4/2013 234 ABC mouse pad
and i want to show result as
Date Bill_no Item_name cust_name
2/4/2013 234 wireless mouse,wireless keyboard,mouse pad ABC
I can do it in following way:
select Date,Bill_no,
(
select Item_name +',' from table1 a (nolock)
where
for xml path ('')
) as Item_Name,Cust_name
from table1 b(nolock)
where bill_no=234 and custName='ABC'
group by Date,Bill_no,Cust_name
hope it will help you....