question

eso avatar image
eso asked

merge two rows

I have a table names as computer system with info INSTANCE_ID, ASSET_ID,DATE,...ETC

And each INSTANCE_ID associated to one BS_Name from another table names BS there are some cases instance_id associated to two BS_Names and data shows as attatchment1639140300053.png

please advice !

sqlserver2012
1639140300053.png (113.1 KiB)
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
anthony.green avatar image
anthony.green answered

You will need to look at stuff and xml_path

This article will give you some good examples

https://www.mssqltips.com/sqlservertip/2914/rolling-up-multiple-rows-into-a-single-row-and-column-for-sql-server-data/

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.