将Access Query转换为SQL

时间:2014-09-29 17:17:01

标签: sql ms-access pivot transform

我正在尝试转换此Access查询,以便它在SQL中工作。必须将数据库移动到SQL,但我没有处理如何将此查询转换为SQL的句柄。我知道它看起来很简单但我没有运气试图制作一个SQL等价物。

以下是查询:

TRANSFORM Max(IIf([datetrained] Is Null,"","X")) AS Trained
SELECT tblEmployees.employee
FROM tblTraining 
INNER JOIN (tblEmployees 
INNER JOIN tblTrainingRecs 
     ON tblEmployees.employeeID = tblTrainingRecs.EmployeeID) 
  ON tblTraining.TrainingID = tblTrainingRecs.TrainingID
GROUP BY tblEmployees.employee
PIVOT tblTraining.TrainingDesc;

事先感谢任何人的帮助!

0 个答案:

没有答案