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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:52:26+00:00 2026-05-27T18:52:26+00:00

I have 2 tables. Table A has just one column called ID which has

  • 0

I have 2 tables. Table A has just one column called ID which has a list of Ids 1 ,2 ….n
Table B has 3 columns: ID (references ID column in table A); key,value
So table B goes like this:

ID  KEY VALUE
1   x   true
1   y   false
1   z   true
2   x   false
2   y   false
2   z   false

..
…..
So each ID from table A has got 3 entries in table B
I need a query that fetches all Ids from table A that has got x,y, and z all marked as false in table B. So if any of x, y, z is true for a particular Id, we do not select it.
I tried this but this is wrong:

select A.id from A,B where A.id = B.id and B.key in ('x','y','z') and B.value = 'false'

Can you please help me with the right query?

  • 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-27T18:52:27+00:00Added an answer on May 27, 2026 at 6:52 pm

    Nearly there:

    select A.id 
    from A,B 
    where A.id = B.id and B.key in ('x','y','z') and B.value = 'false'
    group by A.id
    having count(distinct B.key)=3
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a logging table which has three columns. One column is a unique
I have a table which has several one to many relationships with other tables.
I have a table called Purchase which has a State column, where 1 is
I have a table Administrator with only one column, adminId which is the primary-key.
We have a 10 thousand row table that has just 2 columns, a primary
i have 3 tables A,B and C. table A has column employee_name,id table B
I have two tables, one is a table of forum threads. It has a
I have a dataset with multiple tables. One table in particular has one record
I have a table called users which currently contains column money of type integer
I have an access database with 2 tables. One table has the boolean field

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.