Hi friends,
How can i get the a column's values of one table as column headings of another table?

i.e :
Table a is like this,

A1 A2 A3
X1 Y1 Z1
X2 Y2 Z2
X3 Y3 Z3

Then,table b should have like this,

Y1 Y2 Y3

Please help me to resolve this.
Thanks for your time and efforts.