Solved

Query question

Posted on 2008-10-15
4
144 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 14

Accepted Solution

by:
pteranodon72 earned 80 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

Quiz: What Do These Organizations Have In Common?

Hint: Their teams ended up taking quizzes, too.

Question has a verified solution.

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

I'm trying, I really am. But I've seen so many wrong approaches involving date(time) boundaries I despair about my inability to explain it. I've seen quite a few recently that define a non-leap year as 364 days, or 366 days and the list goes on. …
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

690 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