Query to display column name and value

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Chandra V
    New Member
    • Oct 2011
    • 1

    Query to display column name and value

    Hi,
    I have a table called SetupTable, which contains 35 attributes. all the attributes a re of type Char(1), ususally contain either 'y' or 'n' .

    So, i need a query to display the column name and the value , whose value is 'y' per each row.

    is it posible in Oracle 11g ??


    Appriciate the quick response.
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    Basically, you want to get the table into the following format

    SomeKeyField, AttributeName, AttributeValue

    I don't know if oracle has unpivot but if it does, you can use that. Otherwise, you can use a union query to achieve the same affect.

    Comment

    Working...