I want to fill NULL
values in device
column for each session_id
with an associated non-NULL value. How can I achieve that?
Here is the sample data:
+------------+-------+---------+
| session_id | step | device |
+------------+-------+---------+
| 351acc | step1 | |
| 351acc | step2 | |
| 351acc | step3 | mobile |
| 351acc | step4 | mobile |
| 350bca | step1 | desktop |
| 350bca | step2 | |
| 350bca | step3 | |
| 350bca | step4 | desktop |
+------------+-------+---------+
Desired output:
+------------+-------+---------+
| session_id | step | device |
+------------+-------+---------+
| 351acc | step1 | mobile |
| 351acc | step2 | mobile |
| 351acc | step3 | mobile |
| 351acc | step4 | mobile |
| 350bca | step1 | desktop |
| 350bca | step2 | desktop |
| 350bca | step3 | desktop |
| 350bca | step4 | desktop |
+------------+-------+---------+