?
Solved

Query question

Posted on 2008-10-15
4
Medium Priority
?
150 Views
Last Modified: 2012-05-05
hi,

I have two tables
Table1         Table2
ID   F1          ID      F1
1    aa          1       gg
2    bb          3       hh
3    cc          4       oo
4    dd          
5    ee          

My question is, how can I write a query that can display 2 and 5 from Table1
thx
0
Comment
Question by:mcrmg
  • 3
4 Comments
 
LVL 14

Accepted Solution

by:
pteranodon72 earned 320 total points
ID: 22721257
SELECT * FROM Table1 WHERE Table1.ID Not In (SELECT ID FROM Table2);
0
 

Author Comment

by:mcrmg
ID: 22721276
thank you
0
 

Author Comment

by:mcrmg
ID: 22723856
sorry that the question is closed, if I need to add another condition to it

SELECT * FROM Table1 WHERE Table1.year(D1) Not In (SELECT year(D1) FROM Table2)
and
Table1.month(D1) Not In (SELECT month(D1) FROM Table2)


? it does not work...
0
 

Author Comment

by:mcrmg
ID: 22723869
I think I got it..thx
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

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

One of the most important things in an application is the query performance. This article intends to give you good tips to improve the performance of your queries.
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.
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…
Watch the video to learn how one can deal with PST file corruption issue with an outstanding Kernel for Outlook PST Repair Tool easily. Using this tool, non-technical users can swiftly perform the repair process to restore their essential data witho…
Suggested Courses

589 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