I have a table that looks like this:
Persons:
+---------+----------+----------+
| ID | name | clientID |
+---------+----------+----------+
|001 | carl |002 |
|002 | fred |null |
+---------+----------+----------+
I want the result to be:
+---------+----------+
| name | client |
+---------+----------+
|carl | fred |
+---------+----------+
I can get the output of people with clients with that clients ID (with the following) but not sure how to get the clients name to replace it.
select name, client
from schema.persons
where client is not null
thanks in advance.