Results 1 to 7 of 7

Thread: Column headers

  1. #1
    Join Date
    Nov 2009
    Posts
    7

    Unanswered: Column headers

    -------------------------
    CAT FUNCTIONS
    -------------------------
    S B D
    Z A M Z
    E N L L I I
    F D O A L E
    U Z W P U L
    N I C A S C
    CAT COUNT I O Z C I Z
    NAME GROUP SEX CATS O R Y Z A Y sum
    --------------- ----- ----- ---- ---- -- ---- ---- ---- -----
    BIALI LOWCY Female 2 0 0 61 0 0 55 116
    Man 2 0 88 0 0 43 0 131


    CZARNI RYCERZE Female 2 0 0 65 0 0 52 117
    Man 3 0 93 67 56 0 0 216

    ....

    Hello all,

    I have a small problem becasue, i dont know how to genearte raport with SQL Plus to like this upper one raport(headers).

    My problem is how to make cat functions to be a column header like in upper one raport.

    The Cat_table(
    cat_name PK,
    cat_function VARCHAR2,
    cat_group FK
    cat_eat NUMBER,
    cat_sex VARCHAR2(1)
    )

    please help,
    thank you adam

    removed all white spaces, the result is in attachment,
    best regards
    Attached Thumbnails Attached Thumbnails result.jpg  
    Last edited by adamoo; 11-18-09 at 09:33. Reason: removed white spaces

  2. #2
    Join Date
    Aug 2009
    Posts
    262
    give me the select statement which you are using for this report .

  3. #3
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    I don't think that it is the SELECT, but ... HEADER. If I understood it correctly, this is what he has got:
    Code:
    SQL> select deptno, empno from emp;
    
        DEPTNO      EMPNO
    ---------- ----------
            20         73
            30         74
            30         75
    And this is what he would like to get:
    Code:
    D   E
    E   M
    P   P
    T   N
    N   O
    O
    -- --
    20 73
    30 74
    30 75
    I wouldn't know how to do that.

  4. #4
    Join Date
    Nov 2009
    Posts
    7
    I want do like this:

    Code:
    select COUNT(*)
    from employes
    group by company, sex, job
    And result:

    Code:
    Comapny SEX   POSTMAN(vertically)  BODYGOUARD(vertically)
    --------  ---   --------------------  ------------------------
    XYZ        M     1                             2
                 W     0                             3
    But i think sql plus dosent give such a ability, and i have to do it manually.


    Littlefoot

    if you want do headers like this u can use sql plus format

    Code:
    COLUMN deptno FROMAT A1
    Thanks,
    Adam

  5. #5
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Quote Originally Posted by adamoo View Post
    Littlefoot

    if you want do headers like this u can use sql plus format

    Code:
    COLUMN deptno FROMAT A1
    I don't think so; column value is restricted to 1 character width, but header doesn't reflect that (i.e. only the very first header character is displayed, not the whole column name):
    Code:
    SQL> column dname format a1
    SQL> select dname from dept;
    
    D         --> see? D is here, but where's NAME (DNAME)?
    -
    A
    C
    C
    O
    U
    N
    T
    I
    N
    G

  6. #6
    Join Date
    Nov 2009
    Posts
    7
    yup, you have right i thought about

    Code:
    COLUMN dname HEADING FORMAT A1
    But it dosent work

    We can do like this:

    Code:
    COLUMN dname HEADING 'd|n|a|m|e'
    Best regards,
    Adam

  7. #7
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Now that's something different (and I've learned something new)! Thank you!

Tags for this Thread

Posting Permissions

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