Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6621689
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T21:18:00+00:00 2026-05-25T21:18:00+00:00

Example my db structure olddb & newdb newdb ID email Name ———————– 1 john@yahoo.com

  • 0

Example my db structure olddb & newdb

newdb

ID email           Name
-----------------------
1  john@yahoo.com  John
2  peter@yahoo.com Peter

olddb

ID email           
-------------------
1  john@yahoo.com  
2  peter@yahoo.com 
3  rambo@hello.com
4  super@duper.com

Now I want compare olddb with newdb and delete from olddb which email doesn’t have email in newdb

Let me know

DELETE FROM olddb, newdb
USING olddb
    INNER JOIN newdb USING(email) 
WHERE olddb.email <> newdb.email
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T21:18:00+00:00Added an answer on May 25, 2026 at 9:18 pm

    This will give you a list of all emails from oldtbl which are not on newtbl:

    SELECT * 
    FROM oldtbl
    WHERE id NOT IN (
       SELECT id FROM newtbl
    )
    

    Note: oldtbl and newtbl because I found your naming scheme confusing. We are talkind about tables, not databases.

    To delete those rows on oldtbl, just change SELECT * with DELETE.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Example my table structure current_db ID email name address phone --------------------------------------------- 1 email@email.com John
Based on the following example URL structure: mysite.com/mypage.aspx?a=red&b=green&c=blue Pages in the application use ASP.net
I have a directory structure like com/example/web under the root directory which contains a
I have an existing journal website with the following url structure http://example.com/dbtable_id/ (eg. http://example.com/89348/)
document structure example is: { dob: 12-13-2001, name: Kam, visits: { 0: { service_date:
I'm implementing a DFS for a (linked list) Graph. My graph structure example: https://i.stack.imgur.com/8GX7V.png
I have the follow structure (example): trunk/ branches/v1.0.0 branches/v1.0.1 tags/v1.0.0 My question is: The
I have following structure with example data: id season_id title 1 1 Intro 2
In the following example a std::map structure is filled with 26 values from A
Can you give an example where the Queue data structure can be specially helpful

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.