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 8045401
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T05:32:07+00:00 2026-06-05T05:32:07+00:00

Strange thing happening. I am having a problem with my MySQL Community Server 5.1

  • 0

Strange thing happening. I am having a problem with my MySQL Community Server 5.1 installed on windows NOT IN query. When I do this query:

select * 
  from table1 
  where date >= "2012-01-01";

returns 582 rows

select * 
  from table1 
  where date >= "2012-01-01" 
    and the_key in (select some_key from table2);

returns 15 rows

so I would expect that the following query would return 582 – 15 = 567 rows

select * 
 from table1 
 where date >= "2012-01-01" 
 and the_key not in (select some_key from table2);

returns 0 rows

Why is this last query not returning any rows?

  • 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-06-05T05:32:10+00:00Added an answer on June 5, 2026 at 5:32 am

    Try this.

    select * 
     from table1 
     where date >= "2012-01-01" 
     and `key` not in (select some_key from table2 where some_key is not null);
    

    Or using not exists

     select * 
     from table1 
     where date >= "2012-01-01" and not exists ( select some_key from table2 where table2.some_key = table1.key
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having this strange problem where my merge() or my persist() functions are not
I have the following query, now the strange thing is if I run this
I'm having a strange problem and not sure how to troubleshoot it. I have
I'm having an extremely strange problem with ant. This snippet produces a set of
Possible Duplicate: Generate multiple graphics from within an R function Very strange thing happening
Strange thing...theres no code this time but the using System.ServiceProcess; import gets a red
I have this strange thing with input and output streams, whitch I just can't
Strange thing happening to me with the PreApplicationStartMethod Attribute. I did implement it in
I've got a strange thing happening I dont understand. if I run the method
A very strange thing is happening. I am running a script on a new

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.