Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2004
    Posts
    12

    Unanswered: userfriendly result

    Hello,
    I have following result set

    TEXT ANZAHL STATUS
    -------------- ---------- --------------
    AAAAAAA 540 3
    AAAAAAA 72 7
    BBBBBBB 93 1
    BBBBBBB 210 3
    BBBBBBB 12 7
    CCCCCCC 14 1
    CCCCCCC 12 3

    I get this with following sql statement:
    select TEXT, count(index) as ANZAHL ,status from Incident group by TEXT, status
    We know from the technical part the meaning of status like following
    1 = "Ich"
    3 = "habe"
    7 = "grossen"
    211 = "Appetit"
    This information is not available in any table.
    Status values can only be 1 , 3 , 7 and 211 is there a way to display instead of integers their text.
    So result is displayed in following way:

    TEXT ANZAHL STATUS
    -------------- ---------- --------------
    AAAAAAA 540 habe
    AAAAAAA 72 grossen
    BBBBBBB 93 Ich
    BBBBBBB 210 habe
    BBBBBBB 12 grossen
    CCCCCCC 14 Ich
    CCCCCCC 12 habe

    Many thanks in advance,
    Thomas
    Last edited by einfachtom; 02-04-05 at 06:24.

  2. #2
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Try this:
    Code:
    SELECT text, COUNT(index) anzahl, 
      DECODE(status, 1, 'Ich', 3, 'habe', 7, 'grossen', 211, 'Appetit', status) status
      FROM incident
      GROUP BY text, DECODE(status, 1, 'Ich', 3, 'habe', 7, 'grossen', 211, 'Appetit', status);

  3. #3
    Join Date
    Aug 2004
    Posts
    12
    Great it's working fine -many thanks

Posting Permissions

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