Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


SQL Outer Join Query Issue

Posted on 2007-08-09
Medium Priority
Last Modified: 2013-11-05
I am trying to find all of the records in table 2 that do not exsist in Table 1 with some criteria like are open for business. I am using SQL 2000.
Question by:mwhodges
LVL 19

Accepted Solution

Limbeck earned 500 total points
ID: 19664866
select * from table1 left outter join table2 on table1.somefield = table2.somefield where table2.somefield is null

change somefield to a unique field in the tables
LVL 61

Expert Comment

ID: 19664887
Assuming you have a common ID field:

SELECT Table2.*
FROM table2 LEFT JOIN Table1 on Table2.ID = Table1.ID
WHERE Table2.OpenForBusiness = true and Tabale1.ID IS Null

Author Comment

ID: 19665076
Thanks for your quick responses. That fixed it.

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
This month, Experts Exchange sat down with resident SQL expert, Jim Horn, for an in-depth look into the makings of a successful career in SQL.
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…

578 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question