sql server - SQL Query - Combine multiple rows to one row -
this question has answer here:
how write sql combine data multiple columns , rows 1 row.
organizationid name type active -------------------------------------- 1 baker county yes 2 curry county yes
expected result:
somecolumnname ------------------------------- 1bakercountyyes2currycountyyes
mysql
use group_concat.
select row_id, group_concat( value order value separator ' ') (select @row_number:=1 row_id, concat(organizationid ,name,type,active) value table1 order file_fields_id ) t group row_id;
Comments
Post a Comment