I am pretty basic in my sql code, but I am trying to find a way to decide when a change occurs in a set of data.
I have a 3 columns where column 1 (AgreementNr) can have many records. Each of these records are associated with a Sysnr after an invoice is produced. The AgreementNr also have a Name connected to it. This Name will usually be the same from Sysnr to Sysnr, but occationally that Name can change.
I am trying to find an elegant way to extract out the instances where such a change occurs. In the below table there are 3 sets of Agreementnr (colormarked) , where each has a set of different Sysnr. What I looking for is only those that the change in name occurs, marked with dots and extracted as a separate table at the bottom. My problem seem to be the SysNr which is different in each instance, but I need this to be able to pinpoint where change happened.
All info is in one table.
Is there any way I can achieve this easily?
SysNr
? Is that column unique?