Jump to content

Creating column names from row values


justinbriggs1
 Share

Recommended Posts

Hey all, I've been tasked with cleaning up a query due to the delay we are getting with the results. My question is, how do I create a select statement which will return row values as column names?For example:Here is how the table is currently configured. Sorry it looks so jacked up, the column names are in brackets, with the corresponding rows below.[id_problem] [node_name] [node_value]2----------------urgency--------Whenever2------------------name-------A. Aaronson 2-----------------phone---------555-5555I would my select statement to return something like this:[id_problem]------[urgency]-------[name]-----------[phone]2------------------Whenever------A.Aaronson--------555-5555Any help would be appreciated, thanks.JW

Edited by jwburnside
Link to comment
Share on other sites

I am not sure about row value as column name. But it seems you need to use self join here...if i am not missunderstanding

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...