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

  • Home
  • SEARCH
  • 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 7407219
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T05:40:46+00:00 2026-05-29T05:40:46+00:00

Ok my objective is to query table 1 for data, but make sure that

  • 0

Ok my objective is to query table 1 for data, but make sure that the data has not already been presented by checking in table 2.

Each data has an ID which is under the UUID column.

Select * FROM table1 Where Not Exists
(SELECT * FROM table2 WHERE table2.UUID = table1.UUID);

But I have researched and I have tried every possible way to write that query and I keep getting:

“ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘WHERE NOT EXISTS (SELECT * FROM table2 WHERE table2.UUID = table1.UUID) at line 1”

Any help?

Also some of the articles I found on the internet suggest that a join would be more efficient, but others state that where not exists is better. Which is the more efficient route?

Thanks

  • 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-29T05:40:46+00:00Added an answer on May 29, 2026 at 5:40 am

    i think you have to that like this:

    SELECT UUID, ...
    FROM Table1
    WHERE UUID NOT IN
            (SELECT UUID FROM Table2 WHERE Table2.UUID = Table1.UUID)
    

    this means that the query selects all records from table1 where UUID in table1 does not exist in table2

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

Sidebar

Related Questions

I'm new here and I hope I'm not asking something which has already been
Hallo, my objective is to generate a table that shows the total of each
I have a SQL query that contains a derieved table. The derived query looks
it is possible that similar questions have been asked earlier, but I can't find
I have a table that I need to extract data from, and wish to
In a nutshell: I have some database table data that I want to populate
Objective-C has no namespaces; it's much like C, everything is within one global namespace.
Objective : Make a progress bar where users can check how much of a
Objective: In support of a Windows Service that may have multiple instances on a
I am trying to write a query that rates how well a particular object

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.