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

The Archive Base Latest Questions

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

I want to create a select query that checks for a certain value (example

  • 0

I want to create a select query that checks for a certain value (example below: ‘green’) in table 1, if exists, it finds the same id in table 2 and displays that rows data.

table 1

id car
1  black
2  green

table 2

id  status
1   old
2  broken

So the result should be: ‘broken’.

Heres my code:

SELECT TOP 100 car CASE WHEN table1.car IN ('green') THEN Table2.status END AS 'result'
FROM Table1.ID INNER JOIN Table2.ID
  • 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:46:54+00:00Added an answer on May 23, 2026 at 5:46 pm
    SELECT t1.car, t2.status AS result
        FROM Table1 t1
            INNER JOIN Table2 t2
                ON t1.id = t2.id
        WHERE t1.car = 'green'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How to select a same database? I want to create a table from already
I want to create a function that has a select query inside that can
I have to create a query that checks across several different columns, and if
I want a query to create a one row table with as many columns
I want to create a SQL Select to do a unit test in MS
I want to create the following T-SQL statement: SELECT SUM (sa.Amount) as 'SumAmount', SUM(sa.Cost)
My sql table is something like (message,created) I want to select those rows which
I have created a table in my application, I want to select (change background
I'm trying to create a query on SQL server 2005 that will check if
I want to make this query on Symfony/Propel SELECT folders.NAME, COUNT(documents.NAME), COUNT(files.idfiles), SUM(files.size) FROM

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.