我想爲此sql語句創建一個以前工作正常的視圖。但是當我將它創建爲視圖時,出現一個錯誤提示,"View's SELECT contains a variable or parameter."
任何人都可以告訴我錯誤在哪裏,因爲我對MySQL中的視圖很陌生。謝謝!在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語句創建視圖時的錯誤。
的可能重複[燦我用MySQL中的參數創建視圖?](http://stackoverflow.com/questions/2281890/can-i-create-view-with-parameter-in-mysql) – zerkms