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

The Archive Base Latest Questions

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

I have a table as follows: table 1 temp_id node_name variable_1 variable_2 variable_3 1

  • 0

I have a table as follows:
table 1

temp_id    node_name  variable_1 variable_2 variable_3
1          ab         a          b           y
2          sdd        a          a           a
3          u          a          s           s

and another table as follows:
table 2

temp_id    node_name  variable_1 variable_2 variable_3
1          ab         as        sb           y
2          sdd        a          a           a
3          u          a          s           s

I want to fetch all the records from table 1 where variable_1, variable_2 and variable_3 of table 1 doesnot match with table 2.

How can I do that in TSQL?

  • 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-25T17:53:59+00:00Added an answer on May 25, 2026 at 5:53 pm
    SELECT * FROM [table 1] t1
    WHERE NOT EXISTS (
        SELECT * FROM [table 2] t2
        WHERE
            t1.variable_1 = t2.variable_1
            AND t1.variable_2 = t2.variable_2
            AND t1.variable_3 = t2.variable_3
    )
    

    —EDIT—

    The above will “fetch all the records from table 1 where variable_1, variable_2 and variable_3 of table 1 doesnot match with table 2”, as you asked.

    However, it seems that you want to match the specific rows from table 2 not just any rows (BTW, you should have specified that in your question). If that is the case, Marco’s answer looks good.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have table as follows: SYS_ID SUB_NET_ID NODE_NAME NODE_ID NODE_EQ_NO NODE_VAR_NO TEMP_ID EQUIP_TYPE EQ_ID
I have a table with sales per store as follows: SQL> select * from
I have a table like follows: mysql> select * from tries; +----+--------+-----------+ | id
I have a table as follows > RowID SessionID EventID RequestedURL Date > 1
I have a table like as follows: SoftwareName Count Country Project 15 Canada Visio
I have a table set up as follows id origin destination carrier_id so typical
We have a table set up as follows: |ID|EmployeeID|Date |Category |Hours| |1 |1 |1/1/2010
The architecture for this scenario is as follows: I have a table of items
I have a bidding table, as follows: SellID INT FOREIGN KEY REFERENCES SellItem(SellID), CusID
I have a simple table in Sybase, let's say it looks as follows: CREATE

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.