Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2005
    Posts
    13

    Red face Unanswered: Not Exists Predicates

    I have two tables like these;
    LIB NAME SRCLIB SRCFILE SRCMBR
    --- ---- ------ ------- ------
    fd ds fds ee aw
    aa aa aa aa aa
    we nb ty ya as
    bv sd de aa as

    and

    SRCLIBB SRCFILEB SRCMBRB
    ------- -------- -------
    de aa as
    ty aa as
    .
    SRCLIB=SRCLIBB
    SRCFILE=SRCFILEB
    SRCMBR=SRCMBRB
    and I want to see lib and name where not in second table.
    At last, I want to see

    LIB NAME
    --- ----
    fd ds
    aa aa
    we nb

    .

  2. #2
    Join Date
    Feb 2005
    Posts
    13

    :-)

    I did it

    SELECT A.LIB, A."NAME" FROM BUSRA.ATABLE AS A EXCEPT SELECT ATA
    BLE.LIB, ATABLE."NAME" FROM BUSRA.ATABLE AS ATABLE, BUSRA.BTABLE AS BTABLE wHERE ATABLE.SRCLIB = BTA
    BLE.SRCLIBB AND ATABLE.SRCFILE = BTABLE.SRCFILEB AND ATABLE.SRCMBR = BTABLE.SRCMBRB


Posting Permissions

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