Hi,
I need help to get the solution of following scenario:
I have table with 4 primary key : PK1,PK2,PK3,PK4.
Input table :
PK1 | PK2 | PK3 | PK4 |
T1 | a | b | c |
T1 | b | c | d |
T2 | b | c | d |
T2 | a | b | c |
1st load I need to generate the count as per PK1.
PK1 | PK2 | PK3 | PK4 | Count |
T1 | a | b | c | 1 |
T1 | b | c | d | 2 |
T2 | b | c | d | 1 |
T2 | a | b | c | 2 |
2nd load will be delta load,
If i will get input table like :
PK1 | PK2 | PK3 | PK4 |
T1 | d | e | f |
T2 | b | c | d |
T2 | a | b | c |
I should get output like:
PK1 | PK2 | PK3 | PK4 | Count |
T1 | a | b | c | 1 |
T1 | b | c | d | 2 |
T1 | d | e | f | 3 |
T2 | b | c | d | 1 |
T2 | a | b | c | 2 |
Any help will be much appreciated.
Thanks in advance.
Warm Regards,
Amit