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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T04:23:07+00:00 2026-05-24T04:23:07+00:00

I have two Tables say Table-A and Table-B having same table structure (means number

  • 0

I have two Tables say Table-A and Table-B having same table structure (means number of columns are same) and having same number of Records with same Primary key value.

It is having Column-Id data is same in both the tables but some columns values are Different.

Now I want a Select query which will return those columns only which are having different data in Tables-A and Table-B

Example :

Table-A
ID  Name   RollNo  Status
1   Gourav 22      1

Table-B
ID  Name   RollNo  Status
1   Gourav 24      0

OUTPUT Required is :

Table-C
Id  RollNo-A  RollNo-B  sts-A  sts-B
1   22        24        1      0

Please suggest.
Please provide Solution in Sql 2000

  • 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-24T04:23:08+00:00Added an answer on May 24, 2026 at 4:23 am

    This might work.

    SELECT      A.Id
            ,   A.RollNo AS [RollNo_A]
            ,   B.RollNo AS [RollNo_B]
            ,   A.Status AS [Status_A]
            ,   B.Status AS [Status_B]
    FROM        dbo.TableA  A
    INNER JOIN  dbo.TableB  B
    ON          A.Id        =  B.Id
    WHERE       A.RollNo    <> B.RollNo
    OR          A.Status    <> B.Status
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two tables with similar columns - let's say table A with column
I have a view table which is a union of two separate tables (say
Let's say I have 3 tables (significant columns only) Category (catId key , parentCatId)
I have a requirement. I have two tables say TableA and TableB. Both having
I have two tables say, t1 and t2 that have t1.t1_id and t2.t2_id as
Say I have two tables I want to join. Categories: id name ---------- 1
Say we have two tables in an MS Access db: Service Users: | ID
Say I have two tables called A (fields: id, phase, name) and B(fields: id,
I have two tables, both named as say, Employee in two different schema HR
Lets say I have two tables - child and parent with many-to-one relation. What

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.