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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T16:56:43+00:00 2026-06-09T16:56:43+00:00

My original query returns 7975 rows. Adding a where clause, I receive 7917 rows.

  • 0

My original query returns 7975 rows. Adding a where clause, I receive 7917 rows. I want to SELECT the 58 row difference. In an effort to do so, I wrote what I believe to be the inverse where clause. Unfortunetly, I only see 41 rows, instead of the expected 58.

Both TableName.Column and TableName.Column2 are nullable.

Original Where

where ((TableName.Column in ('1', '2', '3))
or (TableName.Column2 in ('1', '2', '3))

My attempt at an inverse

where ((TableName.Column not in ('1', '2', '3))
and (TableName.Column2 not in ('1', '2', '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-09T16:56:45+00:00Added an answer on June 9, 2026 at 4:56 pm

    Your problem is with NULLs. The real inverse is either:

    where (coalesce(TableName.Column, '') not in ('1', '2', '3))
    

    or:

    where tableName is NULL or (TableName.Column not in ('1', '2', '3))
    

    With both columns, this would be:

    where (coalesce(TableName.Column, '') not in ('1', '2', '3)) and
          (coalesce(TableName.Column2, '') not in ('1', '2', '3)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Suppose we got a original query as follows: SELECT A, B, C FROM tblA
Original SQL query is this; SELECT id,post_title,post_date FROM wp_posts where id='1' When I retrieve
I have a query which contains in the select clause: d1.id, d1.title, d1.original_doc, d2.id,
I am adding a 5th table to an existing join. The original query will
I am working on a search/tag system. My original query I wrote was for
Here is original Query :, it generates o/p with two columns name (label, count)
original string is a,d,k I want to remove all , and make it to
I have a nhibernate 3.2 query which returns the first 500 Intervention items (in
A query in a system I maintain returns QID AID DATA 1 2 x
Is it possible to get the information why/how given row returned by FTS query

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.