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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T17:11:18+00:00 2026-06-11T17:11:18+00:00

Here’s the situation. I have two sets of data. One is a list of

  • 0

Here’s the situation. I have two sets of data. One is a list of all the “ticket” entries that my system uses – at least one per ID, but potentially more. I also have a separate list of just the IDs that have known hardware problems, which is a relatively small (but important) subset of the IDs. I’ve put this list into a super-simple table B, which is literally a single column with just those IDs.

I need a MySQL query that joins these two tables, so I get all of the entries from table A, each of which has another field added on that is a simple boolean: whether or not the same ID exists in table B.

So something like this:

SELECT * FROM `table_A` A
LEFT JOIN `table_B` B ON A.id=B.id

If B were a two-column table, and the second column (call it down) was simply true in every row, then I could check if down were true or null.

But since B has only a single column, no data is actually added to the result.

Is there any simple way (without having this otherwise completely unnecessary column in my database) to do this “join” operation, that will simply note whether or not the ID of a given entry in A also exists in B?

(adding another field to A that is up or down is also rather inefficient, since there are often many rows for a single ID and most IDs aren’t going to be down anyway)

  • 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-11T17:11:19+00:00Added an answer on June 11, 2026 at 5:11 pm

    with the example below ‘down’ will not be null if the id exists in table_B

    SELECT * , B.id as `down` FROM `table_A` A
    LEFT JOIN `table_B` B ON A.id=B.id
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is the problem that I am trying to solve. I have two folders
Here is my scenario. I have a website running under AppPool1 and that works
Here is my problem.. I have the option to create(add) two new input fields,
Here are the tables I have: Table A which has entries with item and
Here's the code I have. It works. The only problem is that the first
Here is the issue I am having: I have a large query that needs
Here's my scenario - I have an SSIS job that depends on another prior
here is my code, SiteMember class @OneToMany(mappedBy = member,cascade=CascadeType.ALL) private List<MemberThread> memberThread = new
Here is the Javascript I currently have <script type=text/javascript> $(function() { $('.slideshow').hover( function() {
Here's the basic setup: I have a thin bar at the top of a

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.