sql server 2008 - How do i merge multiple rows data in one row in t-sql but string and numeric both -



sql server 2008 - How do i merge multiple rows data in one row in t-sql but string and numeric both -

data next :

code article amount paid balance 8001 black 8000 7000 1000

i want see this:

8001 (black) (1000)

i think need.

note : if want concatenate numeric datatype info varchar data first have convert numeric data varchar type else may conversion failed error.

select convert(varchar(30), code) + ' (' + article + ') (' + convert(varchar(30), balance) + ')' new_column, article, amount, paid, balance <tablename>

sql-server-2008 tsql

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -