compare two tables - mysql

Posted on 2010-01-11
Medium Priority
Last Modified: 2012-05-08
Hi all.

i have two database called apple and orangel

In the apple i have a table called ABC and the orange also i have a table called ABC. Both ABC table has two field called name, remarks.

now i just want to compare the apple.ABC table to orange.ABC table.

in simple terms, i want to know the records which is not present in the orange.ABC compare to apple. ABC

apple.ABC is upto date. some records are not present in the orange.ABC table.

wanted to identify those missing records.

Question by:Kamaraj Subramanian
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

Accepted Solution

magedroshdy earned 668 total points
ID: 26286278
try this
select *  from apple.ABC where ABC.name not in (select ABC.name from orange.ABC)

Open in new window


Assisted Solution

ViaTom earned 668 total points
ID: 26286280
select a.*
from apple.ABC a
left outer join orange.ABC o on a.name = o.name
where o.name is null
LVL 32

Expert Comment

ID: 26286465
Can names repeat with different remarks?
LVL 32

Assisted Solution

awking00 earned 664 total points
ID: 26286527
See attached.
LVL 23

Author Closing Comment

by:Kamaraj Subramanian
ID: 31675656
Sorry Guys, i didnt get a chance to work on this. Anyway all the answers looks good and hope it will work

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

By, Vadim Tkachenko. In this article we’ll look at ClickHouse on its one year anniversary.
In today's business world, data is more important than ever for informing marketing campaigns. Accessing and using data, however, may not come naturally to some creative marketing professionals. Here are four tips for adapting to wield data for insi…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…

752 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