sql - Transposing Rows to Columns and having values flow down in TSQL -
i using tsql.
if have following results:
and want transpose this:
how can achieve this?
i have following query:
with q ( select * tableone id = 1 union select m.* tableone m join on m.parentid = q.id ) select * q
this gives me of items underneath specified node including specified node.
it easy if add scripting data , not image. note tbl
name of table, called 3 times. try this:
select a.fieldvalue company, b.fieldvalue department, c.fieldvalue job tbl inner join tbl b on a.parentid null , a.id=b.parentid inner join tbl c on b.id= c.parentid
if not bring desired results please add data text , let me know, modify query
wiki
Comments
Post a Comment