• python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Facebook Twitter Instagram
Devs Fixed
  • python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Devs Fixed
Home ยป Resolved: Capturing difference between 2 tables in one table

Resolved: Capturing difference between 2 tables in one table

0
By Isaac Tonny on 16/06/2022 Issue
Share
Facebook Twitter LinkedIn

Question:

I have these two tables:
enter image description here
enter image description here
I want to capture in one table the difference between these 2 tables. Source table has changed columns for ID 1 and ID 3 with different statuses.
My expected table is like below:
expected table
I have tried to do it with MERGE function in T-SQL, but I can’t do it correctly. In my real data I have about 60 columns with statuses, so I want to learn how to do it.

Answer:

here is one approach

If you have better answer, please add a comment about this, thank you!

sql sql-server tsql
Share. Facebook Twitter LinkedIn

Related Posts

Resolved: Table data is coming as empty in React

02/04/2023

Resolved: In a Pinescript v5 Strategy why is my bool not working?

02/04/2023

Resolved: net::ERR_HTTP2_PROTOCOL_ERROR by http get request angular 15.2

02/04/2023

Leave A Reply

© 2023 DEVSFIX.COM

Type above and press Enter to search. Press Esc to cancel.