So I have a table that looks like this:
+---------+-------------+-----------+
| Name | Name_Change | Status |
+---------+-------------+-----------+
| Rick | Brandon | Cancelled |
| Brenda | Alexa | Active |
| Brandon | TJ | Cancelled |
| TJ | Jonathan | Active |
| Randy | | Active |
+---------+-------------+-----------+
So Rick --> Brandon --> TJ --> Jonathan
So my output should be:
+------+------------+--------+
| Name | Final Name | Status |
+------+------------+--------+
| Rick | Jonathan | Active |
+------+------------+--------+
How do I code this on SQL?
TIA