I usually google my questions, since they are not unique only to me. However, this time I can't find answer (probably not using right keywords).
Problem description:
I have two tables.
First table - defenition_list holds unique ID and Name
ID | NAME
-----------
1 | BMW
2 | AUDI
3 | VW
4 | MAZDA
Second Table - used_id holds ID from first table
ID | def_uid1 | def_uid2 | def_uid3
------------------------------------
1 | 2 | 3 | 2
2 | 4 | 2 | 1
So usually If I need to return value of just one column, I would make select like:
SELECT d.NAME, u.def_uid1 FROM defenition_list d, used_id u WHERE d.ID=u.def_uid1
But how to write the query to get names of def_uid2 and def_uid3 at same time? So result would look like:
ID | def_uid1 | def_uid2 | def_uid3 |
--------------------------------------
1 | AUDI | VW | AUDI |
2 | MAZDA | AUDI | BMW |
defenition_list.IDand any/all of the columns inused_idor what?