Hi all,
I hope someone can help me with the following,
I have several (lookup) tables, were id's and names are stored.
All table all brought together by relationships (many to 1) in the
'master' table (by referring to the id's of the records in the lookup
tables).
I want to make a query where all names are looked up using joins:
SELECT
s.[id_master],
s.[date],
s.[description],
s.[table_x_id],
s.[table_y_id],
x.[table_x_name],
y.[table_y_name]
FROM
tblMaster s
join tblX x on s.table_x_id = x.table_x_name
join tblY y on s.table_y_id = y.table_y_name
;
Showing me the corresponding names from tables tblX and tblY, instead of
the id's (that are stored in tblMaster)...
Looks simple, but the SQL statement from above doesn't work!
Many thanks in advance!
Zeff
I hope someone can help me with the following,
I have several (lookup) tables, were id's and names are stored.
All table all brought together by relationships (many to 1) in the
'master' table (by referring to the id's of the records in the lookup
tables).
I want to make a query where all names are looked up using joins:
SELECT
s.[id_master],
s.[date],
s.[description],
s.[table_x_id],
s.[table_y_id],
x.[table_x_name],
y.[table_y_name]
FROM
tblMaster s
join tblX x on s.table_x_id = x.table_x_name
join tblY y on s.table_y_id = y.table_y_name
;
Showing me the corresponding names from tables tblX and tblY, instead of
the id's (that are stored in tblMaster)...
Looks simple, but the SQL statement from above doesn't work!
Many thanks in advance!
Zeff
Comment