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
 General SQL Server Forums
 New to SQL Server Programming
 To join the data in the column

Author  Topic 

Black_Trouble
Starting Member

21 Posts

Posted - 2012-10-01 : 07:04:05
Hi friend,

I want to merge the data in the table below. But in a kind of way I wanted to I could not. Table to as



the result,

2503|2012-09-28|A352|WORLD MECIDINE|A-212023|A-161422,A-161478,A-161537,A-161594,A-161653|18,00|738,72|59,10|797,82





Mike Jackson
Starting Member

37 Posts

Posted - 2012-10-01 : 08:33:27
you want to merge if from where? to where?

Mike
Go to Top of Page

Black_Trouble
Starting Member

21 Posts

Posted - 2012-10-01 : 09:42:45
I'm sorry I forgot to write code. as a group to be merged. IRSFISEVRAKNO1 part of the comma (,) separated by.

[CODE]
SELECT [IRSFISFATREFNO],IRSFISFATTAR,IRSFISCARKOD,IRSFISCARUNVAN,IRSFISFATURANO,IRSFISEVRAKNO1
,IRSFISKDVORANI,IRSFISMALTOP,IRSFISKDVTUTARI,IRSFISGENTOPLAM
FROM IRSFIS
[/CODE]

Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-10-01 : 12:08:41
something like


SELECT *,
STUFF((SELECT ',' + IRSFISEVRAKNO1 FROM IRSFIS
WHERE [IRSFISFATREFNO] =t.IRSFISFATREFNO
AND IRSFISFATTAR = t.IRSFISFATTAR
AND IRSFISCARKOD = t.IRSFISCARKOD
AND IRSFISCARUNVAN = t.IRSFISCARUNVAN
AND IRSFISFATURANO = t.IRSFISFATURANO
FOR XML PATH('')),1,1,'') AS ValueList
FROM
(
SELECT DISTINCT [IRSFISFATREFNO],IRSFISFATTAR,IRSFISCARKOD,IRSFISCARUNVAN,IRSFISFATURANO
,IRSFISKDVORANI,IRSFISMALTOP,IRSFISKDVTUTARI,IRSFISGENTOPLAM
FROM IRSFIS
)t


------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

Black_Trouble
Starting Member

21 Posts

Posted - 2012-10-02 : 05:28:51
Thank you very much. With a few tweaks came in the shape you want. :)
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-10-02 : 10:29:38
welcome

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -