Skip to content

TSQL find number of correspondences

I have the following table: Test Data: I need to find out how many times correspondence has been between each pair. For example, Anthony has contacted John 5 times, John has contacted Anthony 5 times. So total correspondence between John and Anthony has been 10 times. Similarly, David has contacted John total…

SQL Interview Test

Having been given the following question as part of an interview I am keen to know the optimum solution. The question has been edited so that it is not identifiable. Question Table ‘transactions’ …