I have a table that has 2 relations with two other different tables.

```
User
id_user

Users_Licenses   (one-to-many unidirectional)
user(coach)
license_id

License
id
user_id (user simple) (one-to-one user)

```

Now I have to return the username of the user (one-to-one) or null if there is no one but I am not sure how to do that, because it always returns me the username of the coach.
What I've tried:

```
SELECT ul.license_id, u.username, cl.created_at
FROM user u
INNER JOIN users_licenses ul ON ul.user_id = u.id
INNER JOIN license l ON l.id = ul.license_id
WHERE ul.user_id = :coachId

```