我想为这个以前可以正常工作的 sql 语句创建一个视图。但是当我将它创建到一个视图中时,一个错误提示显示,"View's SELECT contains a variable or parameter."
谁能告诉我错误在哪里,因为我对 MySQL 中的视图很陌生。谢谢!
CREATE VIEW `satsschema`.`viewTimeBreak` AS
SELECT a.EmpName, CONCAT(b.StartTime, '-', b.EndTime) AS ShiftTime, CONCAT(a.EmpTime, '-', ADDTIME(a.EmpTime, '0 1:0:0.000000')) AS BreakTime, a.Break,
a.EmployeeOnBreak, '' AS SignIn, '' AS SignOut
FROM satsschema.employeeslot a INNER JOIN
satsschema.ufis b ON b.UFISID = a.UFISEmpGroup
WHERE (a.AllocationDate = @AllocationDate) AND (a.LocationName = @LocationName) AND (a.Break = 1)
GROUP BY a.EmpName
这部分显示了我尝试使用 sql 语句创建视图时的错误。