我想在此表中添加另一列,如果第一期的模式是“现金”,第二期的模式是“电子”,则在 PersonID 前面会显示“现金到电子”。
PersonID InstalmentNumber DateOfInstalment Mode
50023467 2 15-Mar-12 Electronic
50023467 1 15-Feb-12 Electronic
50023468 2 5-Apr-12 Cash
50023468 1 5-Mar-12 Cash
50023469 2 15-Mar-12 Electronic
50023469 2 15-Mar-12 Electronic
50023469 1 15-Feb-12 Electronic
50023469 1 15-Feb-12 Cash
50027967 2 15-Mar-12 Electronic
预期输出:
PersonID InstalmentNumber DateOfInstalment Mode Flag
50023467 2 15-Mar-12 Electronic
50023467 1 15-Feb-12 Electronic
50023468 2 5-Apr-12 Cash
50023468 1 5-Mar-12 Cash
50023469 2 15-Mar-12 Electronic
50023469 2 15-Mar-12 Electronic
50023469 1 15-Feb-12 Cash
50023469 1 15-Feb-12 Cash Cash To Electronic
50027967 2 15-Mar-12 Electronic