Dynamic Header Column When Exec Query
I have 2 tables A & B
CREATE TABLE tst.tableB(id int,code_ varchar(30));
CREATE TABLE tst.tableA(id int,code_ varchar(30));
A and B have the join column id.
the value in A:
1 |a1 |
the value in B:
1 |b1 |
1 |b2 |
I want the result of the select query looks like this:
b1 | b2
I need a dynamic header column from the b table, the hander can be changed in each select query.
Does anyone have an idea how to do this?