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

c - Compilation of a code: unkown type name string -

java - Bypassing "final local variable defined in an enclosing type" -

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