zapytanie sql łączące dwie kolumny z jedną
Mam 2 tabele w ms dostęp 2010 jak poniżej
USERS (u_id, u_name)
LOAN (l_id, l_from[ref users.u_id], l_to[ref users.u_id], l_amount)
Users
+------+--------+
| u_id | u_name |
+------+--------+
| 1 | abc |
| 2 | def |
+------+--------+
Loan
+-----+--------+------+----------+
|l_id | l_from | l_to | l_amount |
+-----+--------+------+----------+
| 1 | 2 | 1 | 100 |
| 2 | 2 | 1 | 100 |
| 3 | 1 | 1 | 50 |
+-----+--------+------+----------+
Chcę wybrać nazwy zamiast liczb (l_from i l_to) z tabeli pożyczek
select
loan.l_id,
loan.l_from,
users.u_name user_from,
loan.l_to,
users.u_name as user_to,
loan.l_amount
from loan, users
where ???