Results 1 to 2 of 2

Thread: Views

  1. #1
    Join Date
    Mar 2004
    Posts
    14

    Unanswered: Views

    HI EVERYBODY:
    I GOT A PROBLEM ON DB2/400, I WANT TO CREATE A VIEW USING UNION CLAUSE BUT WHEN I RUN MY QUERY THE FOLLOW ERROR MESSAGE APPEARS "UNION OR UNION ALL NOT VALID"

    MY QUERY IS SOMETHING LIKE THAT:

    CREATE VIEW V1
    AS
    SELECT 'A' AS T, AREANT AS AREA, AGT AS AGENTE, FEC AS FECHA
    FROM DMVTAS/VENTAS

    UNION
    SELECT 'B' AS T, AREA AS AREA, AGTCTE AS AGENTE, FEC AS FECHA
    FROM DMVTAS/CLIE

    I HOPE THAT YOU CAN HELP ME

    CRISTOPHER SERRATO

  2. #2
    Join Date
    Jan 2003
    Posts
    1,605
    Hi,

    What version of DB2 are you using? UNION and UNION ALL is a new feature in DB2 v8. Are you using any older version of DB2?

    Hope this helps,
    Grofaty

Posting Permissions

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