J
JL
Can anyone help me with how to write a query to display (look-up) a string
of values from another table?
How do I write a query to display the SkillName field along with the other
Member details?
I have a SkillSets table containing fields "SkillName" (text) and "SId"
(text 3 chars.) which is the primary key.
E.g. Table "SkillSets"
SId SkillName
T21 Telesales
M36 Management
I also have a table named Members with a field "Skills" that holds the
member's various skills (a comma delimited string of values corresponding to
the "SId" in the SkillSets table).
E.g. Table "Members"
Name Country Skills
Mark UK M14, T22, D23, B16
Anne USA A12, T22
I have tried various combinations of JOINs but when the field has more than
1 single SId value separated by a comma, nothing displays.
This sort of thing is what I've been trying to use - but to no avail:
SELECT [M.Name], [M.Country], [S.SId], [S.SkillName], [M.Skills]
FROM Members AS M LEFT JOIN SkillSets AS S ON S.SId LIKE M.Skills
GROUP BY M.Name, M.Country, S.SId, S.SkillName, M.Skills
(I've tried various versions of this type of query - the single values of
the M.Skills fields display the correct SkillName but multiple values do
not).
What I want to achieve is the following, via a query (or any other method):
Name Country SkillNames
Mark UK Management, Teaching, Driving, Banking
Anne USA Accountancy, Teaching
etc.
Any help is greatly appreciated.
JL
of values from another table?
How do I write a query to display the SkillName field along with the other
Member details?
I have a SkillSets table containing fields "SkillName" (text) and "SId"
(text 3 chars.) which is the primary key.
E.g. Table "SkillSets"
SId SkillName
T21 Telesales
M36 Management
I also have a table named Members with a field "Skills" that holds the
member's various skills (a comma delimited string of values corresponding to
the "SId" in the SkillSets table).
E.g. Table "Members"
Name Country Skills
Mark UK M14, T22, D23, B16
Anne USA A12, T22
I have tried various combinations of JOINs but when the field has more than
1 single SId value separated by a comma, nothing displays.
This sort of thing is what I've been trying to use - but to no avail:
SELECT [M.Name], [M.Country], [S.SId], [S.SkillName], [M.Skills]
FROM Members AS M LEFT JOIN SkillSets AS S ON S.SId LIKE M.Skills
GROUP BY M.Name, M.Country, S.SId, S.SkillName, M.Skills
(I've tried various versions of this type of query - the single values of
the M.Skills fields display the correct SkillName but multiple values do
not).
What I want to achieve is the following, via a query (or any other method):
Name Country SkillNames
Mark UK Management, Teaching, Driving, Banking
Anne USA Accountancy, Teaching
etc.
Any help is greatly appreciated.
JL