I need to do an integration between two sws in the house and I need help.
I have an integration table (3rd) that will receive the data of a new management, if it is created or modified.
For this, I have a view that brings the source data and I have a table with all the managements registered in the destination to make a comparison.
The idea is to make a comparison between source and destination. If there is a management name in the source that does not exist in the destination, it compares the ids. If the Id does not exist, it inserts the information in a 3rd table. If Id exists, enter the same data in the 3rd table. The source table may return many rows in this comparison.
My problem is with the comparison. I can not program so that I have only 1 line corresponding to the ID and the new Management, which will be inserted in my 3rd table.