By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,856 Members | 2,149 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,856 IT Pros & Developers. It's quick & easy.

Data not eisting in tables

P: 1
I amm having one of those DBA brain locks. I have two tables lets say table_1 and Table_2. The Join column in both (indexed) is col_1 ( variable character 75 ).

what I need to do is produce a record of those records in Table_1 that are not in
Table_2

over simplified example Data

Table_1 Col_1 Table_2 Col_1

abcd abcd
wxyz egka
wxyz wxyz

the Query needs to return "egka"
Jan 20 '09 #1
Share this Question
Share on Google+
2 Replies


sagark
P: 12
You can use query something like this -

"Select Col_2 from Table_2 where Col_2 not in (Select Col_1 from Table_1)"
Jan 21 '09 #2

ck9663
Expert 2.5K+
P: 2,878
Be careful with NOT IN. Read this and this.

Happy Coding!

-- CK
Jan 22 '09 #3

Post your reply

Sign in to post your reply or Sign up for a free account.