If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Not Exists Predicates

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-27-05, 04:52
busrae busrae is offline
Registered User
 
Join Date: Feb 2005
Posts: 13
Red face 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

.
Reply With Quote
  #2 (permalink)  
Old 12-27-05, 05:40
busrae busrae is offline
Registered User
 
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

Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On