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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T20:06:13+00:00 2026-06-11T20:06:13+00:00

Can someone explain me how below query will work.. i have table called employee

  • 0

Can someone explain me how below query will work.. i have table called employee

id FirstName LastName   Email            Groupid
1 Paula      Brown    pb@testdomain.org    12
2 James      Smith    jim@test.co.uk       12
3 James      Connor   jc@tes.co.uk         13


select * from employee where groupid=12 AND id NOT IN (1) OR id NOT IN (2)

how does this query works? Am trying to understand how AND clause works with OR. Any help would be appreciated…

  • 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-11T20:06:14+00:00Added an answer on June 11, 2026 at 8:06 pm

    AND has precedence over OR, so the condition is interpreted as

    (group=12 but id <> 1) OR (id <> 2)
    

    All three records match this condition:

    1 Paula      Brown    pb@testdomain.org    12 -- id <> 2
    2 James      Smith    jim@test.co.uk       12 -- group=12 and id <> 1
    3 James      Connor   jc@tes.co.uk         13 -- id <> 2
    

    If you are looking for a different order of evaluation, you can force it using parentheses.

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

Sidebar

Related Questions

Can someone explain step by step how this query is processed? SELECT F.ID, F.FirstName,
Can someone explain to me why this happens? I have a file called profile.php
Could someone please explain the below query? ID is not PK and there can
Can someone explain this to me? I have two queries below with their results.
hi can someone explain why the coding below does not work but it work
Can someone explain the statement below to me with a working sample/example. thanks in
Can someone explain me the syntax below line 1? I am OK with js
Can someone please explain the purpose of double-negating the reverse var in the below
Can someone please explain below in detail, 1- What is the use of ActivityManager
Can someone please explain the below to me. First is how I call the

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.