RE: Simple SQL Query

From: Joel Slowik <>
Date: Thu, 7 Jan 2010 12:06:21 -0500
Message-ID: <>

Had you tried?:  


From first

Where not exists (select

                                                From second

                                                Where =  

[] On Behalf Of Pani Babu Sent: Thursday, January 07, 2010 12:04 PM To:
Subject: Simple SQL Query  

I have a simple SQL query which lists all the records that are not in a second table.

select from first
where not in (select id from second);

As the second table is very huge, it takes a very long to process the query.
Is there a way to rewrite the query to run it quicker?

Confidentiality Note: This electronic message transmission is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. If you have received this transmission, but are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or use of the contents of this information is strictly prohibited. If you have received this e-mail in error, please contact Continuum Performance Systems at {203.245.5000} and delete and destroy the original message and all copies.

Received on Thu Jan 07 2010 - 11:06:21 CST

Original text of this message