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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:45:12+00:00 2026-05-23T17:45:12+00:00

Let’s say I have a table with the following contents: (just some random values)

  • 0

Let’s say I have a table with the following contents: (just some random values)

year
2005
2009
2010
2912
2982
2947

When I query:

SELECT userid FROM tbluser WHERE year!=2005 or year!=2010

It will output all the years. Why is that?

  • 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-23T17:45:13+00:00Added an answer on May 23, 2026 at 5:45 pm

    The other answers suggest what to do already, but I’d like you to make the test yourself (funnily, I am doing it now…):

    You have

    WHERE year!=2005 or year!=2010
    

    Now, check some number for list against that condition. E.g., use 2011:

    WHERE 2011!=2005    <-- indeed 2011 is not equal to 2005, so this is TRUE
       or 2011!=2010    <-- indeed 2011 is not equal to 2010, so this is TRUE
    

    insert the preliminary results into your condition:

    WHERE TRUE
       or TRUE          <-- if something is TRUE or TRUE, then surely the result
                            is TRUE as well
    

    If you think this further, then the condition is true for every value on the world, because a single value can’t be equal to multiple, different values.

    E.g., use 2005:

    WHERE 2005!=2005    <-- 2005 _is_ equal to 2005, so this is FALSE
       or 2005!=2010    <-- 2005 is not equal to 2010, so this is TRUE
    

    then

    WHERE FALSE
       or TRUE          <-- Read: Where FALSE is true or TRUE is true, summa TRUE.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say I have the string: hello world; some random text; foo; How could
Let's say you have the following two tables: X Table X_ID Y_ID_F X_Value 1
Let's say you have a class called Customer, which contains the following fields: UserName
Let's say I have saved this kind of data (some text '.date(d).' some text)
Let's say I have some content classes like Page, TabGroup, Tab, etc. Certain of
Let's say I have some text as follows: do this, do that, then this,
let's say I have the following string: string s = A B C D
Let's say I have the following entity: public class Store { public List<Product> Products
Let say I have the following desire, to simplify the IConvertible's to allow me
Let's say I have table with column 'URL' whrere I store urls like this

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.