473,387 Members | 1,493 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Compare to fields from two different tables with same structure

2
Hello
I admit I am somewhat of a beginner at this, but I am amazed as to why none of the examples and other help I have found have allowed me to get this working.

I have two tables, table1 and table 2, with the following fields in them both
Email, Date, ID

now what I want to do, is compare the two tables and find the differences, so i can get them matching up. The easy was would be to just copy one from the other, but due to various unforseen reasons, they now differ and I need the data that is different from them, so i can make a complete list over the emails in them both.

I have tried a few things, among others
select Email
from table1
where not exists(select Email from table2 where table2.Email =
table1.Email)

Now Im sure this is wrong, but nothing I have tried works, and I have been all over google,trying probably 50 different ones now, and I cant get anything to work. Im most likely doing it wrong, but I was hoping someone would show me the error of my ways.

Thanks
Regards
Tommy
Apr 4 '07 #1
1 3448
iburyak
1,017 Expert 512MB
Did you try this?


[PHP]select Email
from table1
where not exists(select Email
from table2
where Email = table1.Email
and Date = table1.Date
and ID = table1.ID)[/PHP]
Apr 4 '07 #2

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

Similar topics

2
by: Rachel Curran | last post by:
Please can anybody help me with the following: I have two separate excel spreadsheets that I have imported into access, each sheet holds the same fields. Both spreadsheets hold all information...
5
by: Megan | last post by:
Hi everybody- I'm helping a friend with a music database. She has an old one and is creating a new one. She wants to compare records and fields in the old database with records and fields in the...
2
by: Megan | last post by:
Hi everybody- I have 2 tables, Hearings and Rulings. Both have primary keys called, CaseID, that are autonumbers. I don't want both tables to have the same autonumber. For example, if Hearings...
8
by: Vincent | last post by:
has any one seen a program to compare mdbs'. I have ran into a few of them, but none seem to really do that job. Basically what I need to do is, take 2 access mdb's and check the differences...
9
by: VMI | last post by:
I have two tables and I want to compare these two tables with a query( ie. "select * from A where B.key = A.key") and the result will be stored in a 3rd table (table C). is this possible? If...
4
by: himanshupundir | last post by:
I have two identical tables, now I want to compare them and display the results in a form which looks something like this...CaseID is primary key and it is same for a case in both tables ...
5
by: Edd E | last post by:
Hi, I have a database to store my analyses (Access 2002, WinXp), the basic structure is: TABLE 1 = Sample Info TABLE 2 = Analysis type 1 TABLE 3 = Analysis type 2 TABLE 4 = Analysis type 3 ...
1
by: Nick | last post by:
Does anyone know if there is an easy way to compare a row from table a, to a row in table b with the same structure/field names and return those fields which don't match? I have table_a storing...
13
by: Charlotte | last post by:
Hi, i've googeled to find a asp-script that can compare all the records in two different access databases the mdb's have exactly the same tables what i want is that (the output) all the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.