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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T10:44:46+00:00 2026-06-04T10:44:46+00:00

pulling some info from a MySQL db via openquery: select * from foo where

  • 0

pulling some info from a MySQL db via openquery:

select *
from foo
where bar not in (select bar from foobar)

Now, if I replace the subquery with hardwired numbers, it works fine, but i have near a 1000 numbers i need to exclude. I haven’t been able to figure this out; both queries run fine by themselves. the error always tells me I have an syntax error in ‘select bar from foobar)’

thanks

Edit:

here is the error:

[MySQL][ODBC 3.51 Driver][mysqld-4.0.20-log]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 'select bar from foobar)' at line 3".
  • 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-04T10:44:48+00:00Added an answer on June 4, 2026 at 10:44 am

    The problem can be one, or more of the following situations:

    1. foo is not a table
    2. bar is not a column from foo table
    3. foobar is not a table
    4. bar is not a column from foobar table
    5. bar from foo table and bar from foobar have different (not compatible) datatypes

    It’s possibly a BUG from MYSQL4.0 (check HERE for that info).

    Use NOT EXISTS instead of NOT IN like this:

    select *
    from foo
    where bar NOT EXISTS (select bar from foobar WHERE foobar.bar = foo.bar)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am pulling some data from a mysql table via the following: $result =
I am pulling some data from mysql database using PHP, now I would like
I'm pulling some info from a database then putting it into a DIV and
I'm pulling some text from a database, which contains some carriage returns. When I
I have to store some info (timestamp of post, title and link) from various
I'm pulling some data from a forum and use it to display comments on
I'm pulling some RSS feeds in from YouTube which have invalid UTF8. I can
I am pulling some details from sql server and displaying in data-grid. I would
I am pulling back some data from the twitter query API, and parsing it
I am having some trouble pulling multiple custom post types from a Custom Wordpress

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.