I've got two tables, one that's full of data regularly externally updated called "tblEmployeeLicences":
Expand|Select|Wrap|Line Numbers
- EmployeeID,Name,Licences
- 1001,Bill,Drivers
- 1001,Bill,Forklift
- 1002,Ted,Drivers
- 1002,Ted,Forklift
- 1002,Ted,Crane
EmployeeID,Name,Licence01,Licence02,Licence03...16
I've developed a nested updated/select query to update only the first Licence for each person (it's trivial to get all of them with slight variations on it):
Expand|Select|Wrap|Line Numbers
- UPDATE IDProjectData
- RIGHT JOIN [SELECT TOP 1 Licences
- FROM tblEmployeeLicences
- WHERE EmployeeID = [IDProjectData].[EmployeeID] ]. AS Results
- ON IDProjectData.EmployeeID=Results.EmployeeID
- SET IDProjectData.IDWLicence01 = Results.Licences;
How do I restructure the query so that it just rolls over them all, updating the 'Licence01' column for each employee?
Or should I be going about this a different way?