apologies if this has been answered somewhere, I've had a search but can't find the answer.
I've got 3 SQL tables: employee table (ID, name, etc....) key skills table (id, skill name) link table (employee ID, skill ID)
An employee can obviously have multiple key skills, but I'm trying to report them in 1 row as an 'employee report', like this:
Row 1 - name, dob, key skill 1, key skill 2, etc.... Row 2 - name, dob, key skill 1, key skill 2, etc....
I can get the skills to return as a number of rows using:
SELECT DISTINCT kst.KeySkillName FROM KeySkillsTable
INNER JOIN KeySkillsLinkTable kslt ON kslt.EmployeeId = 2
INNER JOIN KeySkillsTable kst ON kst.Id = kslt.KeySkillsId
but when I put this into a larger select as a subquery I get the following error:
Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.
I presume this is because the subquery returns multiple rows, rather than multiple columns which I need.
Any help anyone can give would be greatly appreciated, thanks in advance.