Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2003
    Posts
    44

    Unanswered: Embedded SELECT in CASE Statement

    Platform: z/OS; DB2 version: 7.2

    The following CASE statement works:
    CASE
    WHEN A.YEAR = B.YEAR
    THEN B.ENTNAME
    ELSE ''
    END AS ENAME

    The following won't work:
    CASE
    WHEN A.YEAR = B.YEAR
    THEN B.ENTNAME
    ELSE (select MAX(B.ENTNAME) FROM T1)
    END AS ENAME

    If I remember right, I thought the embedded SELECT in CASE..ELSE worked on DB2 v7 LUW, Won't the embedded SELECT statement work in DB2 v7 for the mainframe? Let me know please, Thanks - EK

  2. #2
    Join Date
    Dec 2005
    Posts
    273
    for mainframe that function becomes available in DB2 V8 - compatibility mode

  3. #3
    Join Date
    Sep 2003
    Posts
    44
    Quote Originally Posted by umayer
    for mainframe that function becomes available in DB2 V8 - compatibility mode
    umayer, thank you

Posting Permissions

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