I have data like this and I am trying to make a table based on t-sql that allows me to see for each unique CPR if the table has a line with both paymenttype 23 and 26, which is the case with CPR 123 below.
It should be fairly simple, but I am new to t-sql and haven't found solutions. Years back with SAS I vaguely recall using a "foreach" statement for stuff like this.
Any help would be very appreciated.
| CPR | Paymenttype |
|---|---|
| 123 | 23 |
| 123 | 26 |
| 111 | 28 |
| 144 | 26 |
| 144 | 27 |