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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:57:11+00:00 2026-05-26T02:57:11+00:00

I have two tables. TableA ( ID int, Match1 char, Match2 char, status char

  • 0

I have two tables.

  • TableA (ID int, Match1 char, Match2 char, status char)
  • TableB (Match1 char, match2)

I want to flag rows in tableA as fail in status where for same match1, match2 do not exist in tableB.

Example:

TableA

ID Match1 Match2 Status
1   100    AB    
2   100    AR
3   200    BC
4   200    VB
5   200    AB

TableB

Match1 Match2
100     AF
100     AR
100     BG
200     AB
200     BJ
200     VB

Expected result:

TableA

ID Match1 Match2 Status
1   100    AB    FAIL 
2   100    AR    NULL
3   200    BC    FAIL
4   200    VB    NULL
5   200    AB    NULL

Thanks

I used(not working):

Update A
set status = 'FAIL'
from TableA A
  Inner join TableB B
  ON A.match1 = B.match1
  WHERE A.match2 <> B.Match2
  • 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-26T02:57:11+00:00Added an answer on May 26, 2026 at 2:57 am
    UPDATE a
        SET status = 'FAIL'
        FROM TableA a
        WHERE NOT EXISTS(SELECT NULL
                             FROM TableB b
                             WHERE a.match1 = b.match1
                                 AND a.match2 = b.match2)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two tables, TableA and TableB: CREATE TABLE `TableA` ( `shared_id` int(10) unsigned
I have two tables: ( ID = int, Match = varchar, Status = char
Hi I want to have two tables each have an INT id column which
I have two related sql server tables ... TableA and TableB. ***TableA - Columns***
Imagine I have two tables. Document int DocumentId (PK) char DocumentName Attribute int DocumentId
I have two tables which looks something like this Table Queue int ID; string
I have two tables. table_x: id INT(11) tag INT(11) table_tags: id INT(11) name VARCHAR(255)
Lets say I have two tables tblA ( tableAID INT IDENTITY(1,1), foo VARCHAR(100)) tblB
i have two tables. BoardPosts BoardPostId INT PK ModifiedOn DATETIME NULLABLE BoardComments BoardCommentId INT
I have those two tables: client: id (int) #PK name (varchar) client_category: id (int)

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.