Is there a way to merge only the last personal_id's where i have values in the columns?
Lets say Anderson with the p_id 2 get married and his name changes.
id p_id last_name job Hobby
1 1 Smith Programmer NULL
2 2 Anderson Influencer Reading
3 2 McKing Influencer NULL
4 3 Jordan Mother Cooking
5 1 Smith NULL Soccer
For example that i get:
p_id: 1 - Smith - Programmer - Soccer
p_id: 2 - McKing - Influencer - Reading
Thanks in advance.
Update:
You guys are really strict.
I have tried a couple of queries but i can't achieve my goal.
SELECT * FROM table GROUP_BY p_id ORDER_BY id ASC