I am having an issue. I need to creat a new column based on row values. so my table is
id | Name | status |
-+-------+-------
1 | ANNA | M |
1 | anna | null |
2 | DIVA | null |
2 | diva | null |
based on the status column I want to create a column new_status. where it will check if the id is same and the value of any row of status column is non null then the new column would have that non null value otherwise it will be null. like the image below
id | Name | status | new_status
--+------+-------+------------
1 | ANNA | M | M
1 | anna | null | M
2 | DIVA | null | null
2 | diva | null | null
please help me with this.