我的查询如下:
SET @MainSQL='SELECT UserProfile.empfullname, UserProfile.UnitId, OrgaMaster.Extension as OrgaID,Payroll.UserID,Payroll.Year,Payroll.PayrollID,<br>
(Case Payroll.Month when '1' then '''January'''<br>
when '2' then '''February'''<br>
when '3' then '''March''' <br>
when '4' then '''April''' <br>
when '5' then '''May''' <br>
when '6' then '''June''' <br>
when '7' then '''July''' <br>
when '8' then '''August'''<br>
when '9' then '''September''' <br>
when '10' then '''October''' <br>
when '11' then '''November''' <br>
when '12' then '''December''' <br>
end)as Month
FROM Payroll INNER JOIN
UserProfile ON Payroll.UserID = UserProfile.UserID inner JOIN
OrgaMaster on UserProfile.UnitId = OrgaMaster.OrgaID Where OrgaMaster.Level=1'
结果仍然显示不正确。如何在sql
答案 0 :(得分:0)