user_id channel user_type score user_band
user1 0 Primary 577 A
user1 0 Secondary 574 B
user1 2 primary 500 c
user2. 0 primary 400 A
I am trying to convert multiple records into single record based on below conditions
- For every distinct "user_id" and channel=0 ,select the record with "user_type" = primary record and replace the values of "score" and "user_band" with values of "user_type" = secondary.
Expected output
user_id channel user_type score user_band
user1 0 Primary 574 B
user1 2 primary 500 c
user2 0 primary 400 A