How to convert rows to into columns in sql query. it is like dynamic
ex: in my dataset getting the columns like
but i need these into abc xyz 123 .If i pass query to another table those rows convert to columns. How can i do this in sql query.