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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T12:52:55+00:00 2026-05-22T12:52:55+00:00

to check the subquery having multiple select statement inside ‘not in’ condition Eg. select

  • 0

to check the subquery having multiple select statement inside ‘not in’ condition

Eg.

select id from tbl where 
id not in (select id from table1) and 
id not in (select id from table2) and
id not in (select id from table3)

instead of repeating the same id ‘not in’ condition , i need the subquery which will check in one shot from multiple tables..

pls help..

  • 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-22T12:52:56+00:00Added an answer on May 22, 2026 at 12:52 pm

    You could use a union, so you just have one in:

    select  id
    from    tbl 
    where   id not in 
            (
            select id from table1
            union all select id from table2
            union all select id from table3
            )
    

    Note: not in does not work well with nullable columns, but I assume id is not nullable here.

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

Sidebar

Related Questions

Check this link! I am having the hardest time trying to figure out why
SELECT username, (SELECT follow FROM follow WHERE follow_user_id = user_id) AS following FROM user
I saw something weird, from the point that was not what I was expecting.
Check this error and please help me. 2009-07-24 15:58:34.209 LBS[2636] Host 'staging.common.virtualearth.net' not found
Check out this page from the New York Times: http://homedelivery.nytimes.com/HDS/learnMorePopUp.do ?mode=common.learnMorePopUp &productId=NDS &prodRate=7.40 I
I have something like ( COMPLEX_EXPRESSION_N stands for a long subquery) select ID_Operation, FirstCheck
Following query runs well in MySQL 5.x SELECT m_area.id, m_area.cn_areaName, m_area.de_areaName, m_area.en_areaName,m_area.jp_areaName,t_shop.count FROM m_area
check the following script: from mechanize import Browser br = Browser() page = br.open('http://scottishladiespool.com/register.php')
I'm having difficulty deleting the desired rows from my table in MySQL. I'm using
Check this URL: http://api.stackoverflow.com/1.1/users/811785/questions?sort=votes It's a URL from StackOveflow's API. The returned JSON is

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.