Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2003
    Location
    New York
    Posts
    6

    Unanswered: What is equivalent of MINUS of Oracle in DB2?

    Hi ,
    I 'm working on DB2 8.1.2. I have a query which was working fine in Oracle. The query is following
    select user_id,login_id from users
    where user_id in
    (SELECT DISTINCT Y.SUPERVISOR_ID FROM REPORTS_TO X, REPORTS_TO Y WHERE X.USER_ID=Y.SUPERVISOR_ID
    MINUS
    SELECT X.SUPERVISOR_ID FROM REPORTS_TO X WHERE X.SUPERVISOR_ID=USER_ID)
    and upper(region_code) = upper(?)

    Now in DB2 the "MINUS" function is not accepted. So how can I rewrite this query to make it work in DB2.

    I will appreciate your help in this.
    Thanks
    Jajati

  2. #2
    Join Date
    Dec 2002
    Posts
    134

    Re: What is equivalent of MINUS of Oracle in DB2?

    check docs for the except/except all

  3. #3
    Join Date
    Sep 2003
    Location
    New York
    Posts
    6
    Cool....This works...I just replaced MINUS by EXCEPT...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
  •