Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2008
    Posts
    2

    Unanswered: A Shorter Version

    Hi. This is my script. Is there any way that I can Shorten this.

    My Range is always from 301 to 341

    SELECT *
    FROM (SELECT T$ITEM,
    sum(decode(T$CWAR,301,T$STOC,0)) "301",
    sum(decode(T$CWAR,302,T$STOC,0)) "302",
    sum(decode(T$CWAR,303,T$STOC,0)) "303",
    sum(decode(T$CWAR,304,T$STOC,0)) "304",
    sum(decode(T$CWAR,305,T$STOC,0)) "305",
    sum(decode(T$CWAR,306,T$STOC,0)) "306",
    sum(decode(T$CWAR,307,T$STOC,0)) "307",
    sum(decode(T$CWAR,308,T$STOC,0)) "308",
    sum(decode(T$CWAR,309,T$STOC,0)) "309",
    sum(decode(T$CWAR,310,T$STOC,0)) "310",
    sum(decode(T$CWAR,311,T$STOC,0)) "311",
    sum(decode(T$CWAR,312,T$STOC,0)) "312",
    sum(decode(T$CWAR,313,T$STOC,0)) "313",
    sum(decode(T$CWAR,314,T$STOC,0)) "314",
    sum(decode(T$CWAR,315,T$STOC,0)) "315",
    sum(decode(T$CWAR,316,T$STOC,0)) "316",
    sum(decode(T$CWAR,317,T$STOC,0)) "317",
    sum(decode(T$CWAR,318,T$STOC,0)) "318",
    sum(decode(T$CWAR,319,T$STOC,0)) "319",
    sum(decode(T$CWAR,320,T$STOC,0)) "320",
    sum(decode(T$CWAR,321,T$STOC,0)) "321",
    sum(decode(T$CWAR,322,T$STOC,0)) "322",
    sum(decode(T$CWAR,323,T$STOC,0)) "323",
    sum(decode(T$CWAR,324,T$STOC,0)) "324",
    sum(decode(T$CWAR,325,T$STOC,0)) "325",
    sum(decode(T$CWAR,326,T$STOC,0)) "326",
    sum(decode(T$CWAR,327,T$STOC,0)) "327",
    sum(decode(T$CWAR,328,T$STOC,0)) "328",
    sum(decode(T$CWAR,329,T$STOC,0)) "329",
    sum(decode(T$CWAR,330,T$STOC,0)) "330",
    sum(decode(T$CWAR,331,T$STOC,0)) "331",
    sum(decode(T$CWAR,332,T$STOC,0)) "332",
    sum(decode(T$CWAR,333,T$STOC,0)) "333",
    sum(decode(T$CWAR,334,T$STOC,0)) "334",
    sum(decode(T$CWAR,335,T$STOC,0)) "335",
    sum(decode(T$CWAR,336,T$STOC,0)) "336",
    sum(decode(T$CWAR,337,T$STOC,0)) "337",
    sum(decode(T$CWAR,338,T$STOC,0)) "338",
    sum(decode(T$CWAR,339,T$STOC,0)) "339",
    sum(decode(T$CWAR,340,T$STOC,0)) "340",
    sum(decode(T$CWAR,341,T$STOC,0)) "341",
    sum(T$STOC) TOTAL

    FROM baandb.ttdinv001700
    GROUP BY T$ITEM)
    ORDER BY 1;

  2. #2
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1
    No, but it doesn't really matter if your query is static.

Posting Permissions

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