SQL-Abfrage, die zwei Spalten mit einer verbindet
Ich habe 2 Tabellen in MS Access 2010 wie folgt
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 |
+-----+--------+------+----------+
Ich möchte Namen anstelle von Nummern (l_von & l_nach) aus der Ausleihtabelle auswählen
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 ???