Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Check if a value in one table doesn't exist

Re: Check if a value in one table doesn't exist

From: <tday6_at_csc.com>
Date: Thu, 25 Oct 2001 07:13:34 -0700
Message-ID: <F001.003B438F.20011025071025@fatcity.com>

If you want to find the one's that don't have a match try:

select id from table1
minus
select id from table2;                                                                                             

                    Roland.Skoldb                                                      
    
                    lom                  To:     Multiple recipients of list ORACLE-L  
    
                    @ica.se              <ORACLE-L_at_fatcity.com>                        
    
                    Sent by: root        cc:                                           
    
                                         Subject:     Check if a value in one table 
doesnt 
                                         exist                                         
    
                    10/25/2001                                                         
    
                    04:00 AM                                                           
    
                    Please                                                             
    
                    respond to                                                         
    
                    ORACLE-L                                                           
    
                                                                                       
    
                                                                                       
    




Hallo you DBA'

Can anyone give me a good example on a sql select statement checking if any value in id field in table one exists in table two's id field?Table two also contains the corresponding id field but with other field names besides. Like this

Table 1: Id         Name      Year
Table 2: :Id   City           Country

Thanks in advance

Roland Sköldblom

--

Please see the official ORACLE-L FAQ: http://www.orafaq.com
--

Author:
  INET: Roland.Skoldblom_at_ica.se

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists

--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).

--

Please see the official ORACLE-L FAQ: http://www.orafaq.com
--

Author:
  INET: tday6_at_csc.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists

--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). Received on Thu Oct 25 2001 - 09:13:34 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US