Results 1 to 8 of 8
  1. #1
    Join Date
    Aug 2008
    Posts
    464

    Unanswered: Displaying data using SQL - 10g

    Hi

    I was wondering if someone could tell me if it is possible to display 2 headers for a column?

    Code:
    E.g.,
    SELECT A+B ABC
    
    ABC (header)
    XYZ (header)
    0
    1
    2
    3
    How do I specify the XYZ part of the header I want to show underneath ABC?

    Regards
    Shajju

  2. #2
    Join Date
    Dec 2007
    Posts
    253
    Code:
    SQL> column my_col heading 'my|col'
    SQL> select 1 my_col from dual;
    
            my
           col
    ----------
             1
    
    SQL>

  3. #3
    Join Date
    Aug 2008
    Posts
    464
    Thanks Pablolee. But I don't want to break a column and display it on 2 lines. I want to add a word to the column and display the column name and the new word on 2 lines.
    I got around this by making the new word part of the column name and using your advice and that did the trick, however, the word displayed at the bottom was right-justified.

    Any ideas how I could bring XYZ to the centre?

    Code:
    E.g., 
    ABCDEF
         XYZ
    Last edited by shajju; 10-07-13 at 07:59.

  4. #4
    Join Date
    Dec 2007
    Posts
    253
    How does that differ from displaying a column header on two different lines? You'll need to be much clearer with your requirements.

  5. #5
    Join Date
    Aug 2008
    Posts
    464
    You're right Pablolee.
    I got it in the centre by padding it with spaces on the right Thanks.

  6. #6
    Join Date
    Dec 2007
    Posts
    253
    Good stuff. Glad you got it sorted

  7. #7
    Join Date
    Aug 2008
    Posts
    464
    Just one small request.

    Is there any other way to do this? Actually my app doesn't accept the

    COLUMN XXXXXXXXXXXXXXXXXXXXXXX

    as a valid SQL query?

  8. #8
    Join Date
    Dec 2007
    Posts
    253
    Well, since you haven't told us what 'your app' is, it's kinda hard to say anything about this. I could potentially give you 30 responses, none of which would be valid in your app.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •