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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T10:40:20+00:00 2026-06-02T10:40:20+00:00

Please review this statement: SELECT TableID FROM Table t1 INNER JOIN BlackList b ON

  • 0

Please review this statement:

   SELECT TableID FROM Table t1
   INNER JOIN BlackList b ON b.TableID <> t1.TableID

I was thinking this statement returned everything from Table that wasn’t found in the Blacklist table, but instead it returned nothing at all (0 rows). If I’m trying to return everything from Table that IS NOT found in the Blacklist table, what’s the best way to do this? I assume you can do this:

  SELECT TableID FROM (
    SELECT TableID, CASE WHEN b.TableID IS NULL THEN 1 ELSE 0 END OnBlackList 
    FROM Table t1
      LEFT JOIN Blacklist b ON b.TableID = t1.TableID
    ) tb1
  WHERE tb1.OnBlackList = 0

But I was looking for a shorter, more efficient solution. Any suggestions?

  • 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-02T10:40:36+00:00Added an answer on June 2, 2026 at 10:40 am

    One basic way is using a NOT EXISTS:

    SELECT TableID FROM Table t1
    where NOT EXISTS (select * from BlackList b where b.TableID = t1.TableID);
    

    This will select rows in t1 that are not present in the BlackList table.

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

Sidebar

Related Questions

[Please note that this is a different question from the already answered How to
Please review the select statement below: SELECT fc.flavorid, fc.flavorname, CASE WHEN sa.flavorid IS NULL
Please review this Stackoverflow post. I have the same PHP problem as bob_cobb. Here's
Please review my code and give me your advise on this: XML file: content.xml
Would someone please review this code and tell me why the for loops are
Please review the example code below, I have a class file that is loaded
This statement is from Apple about my app : We are unable to post
Please consider this code: template<typename T> char (&f(T[1]))[1]; template<typename T> char (&f(...))[2]; int main()
When I upload the image it is showing this error please can u help
I am getting this error that is related to ReportsViewer. I need to eliminate

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.