I have two procedures, that returns data from the same table, but with diffrent where clauses.
In some cases the procedures returns a row that exist in the result from both procedures. (I have an ID field in the table)
Now I need help with a third procedure that executes sp1 and sp2, and if no duplicate row exist it returns the result of sp2.
But if any duplicate rows (same rowID) exsist in both results, the new procedure should return the result of sp2 excluding the rows that exists in the result from both sp1 and sp2.
Tricky to explain my problem in this late hour, my brain get deadlocks all the time now...hope you can understand my problem and help me with it.
In some cases the procedures returns a row that exist in the result from both procedures. (I have an ID field in the table)
Now I need help with a third procedure that executes sp1 and sp2, and if no duplicate row exist it returns the result of sp2.
But if any duplicate rows (same rowID) exsist in both results, the new procedure should return the result of sp2 excluding the rows that exists in the result from both sp1 and sp2.
Tricky to explain my problem in this late hour, my brain get deadlocks all the time now...hope you can understand my problem and help me with it.