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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:56:03+00:00 2026-05-25T11:56:03+00:00

I have a TableA ID MatCh01 Match02 Status 1 1001 12 2 1001 12

  • 0

I have a TableA

ID  MatCh01 Match02 Status
1    1001    12    
2    1001    12
3    1001    12
4    1002    44
5    1002    47
6    1003    22
7    1003    22
8    1004    55
9    1004    57

I want to populate column = status with “FAIL” when :
For same match01, there exist different match02. Expected TableA :

ID  MatCh01 Match02 Status
1    1001    12      NULL   
2    1001    12      NULL
3    1001    12      NULL
4    1002    44      FAIL
5    1002    47      FAIL
6    1003    22      NULL
7    1003    22      NULL
8    1004    55      FAIL
9    1004    57      FAIL

Please NOTE: FAIL all ‘match01’ if its corresponding ‘match02’ is different.
Thanks

  • 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-25T11:56:03+00:00Added an answer on May 25, 2026 at 11:56 am

    Basically this says Update all Values in TableA when the MAX and MIN of Column Match02 are not equal (meaning match01 has multiple rows with different values for match 02).

    UPDATE A
    SET Status = 'FAIL'
    FROM TableA A
    INNER JOIN (SELECT 
                  a2.Match01
                FROM TableA A2
                GROUP BY a2.Match01
                HAVING MAX(Match02) <> MIN(Match02)) B ON
      A.Match01 = B.Match01
    
    • 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 aId aValue TableB bId aId bValue I want to
I want to define the value of columnA in tableA to have the count
I have a table TableA with a computed column FieldA bound to a function
I have a table in my database (TableA) that has a column (TableA.Column1) that
Hallo, I have a join table, said tableA and tableB. tableA have a column
I have an table called TableA which has a column called date_entered which is
I have two tables. TableA ( ID int, Match1 char, Match2 char, status char
I have a tableA (ID int, Match varchar, code char, status = char) ID
In TableA I have an int column. Is it possible using only a select
I have a table TableA with two columns: MyName nvarchar(100) and MyDateTime DateTime .

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.