?
Solved

compare two tables - mysql

Posted on 2010-01-11
5
Medium Priority
?
348 Views
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.

thanks
kamaraj
 
0
Comment
Question by:Kamaraj Subramanian
[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
5 Comments
 
LVL 6

Accepted Solution

by:
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

0
 
LVL 8

Assisted Solution

by:ViaTom
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
0
 
LVL 32

Expert Comment

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

Assisted Solution

by:awking00
awking00 earned 664 total points
ID: 26286527
See attached.
query.txt
0
 
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
0

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