在 MySQL 工作台中执行此 SQL 语句时遇到问题。谁能为我指出问题?
SELECT concat(LocationName,' - ', StationName) AS LocationStation, EmpName AS '0000-0100', EmpName AS '0100-0200', EmpName AS '0200-0300', EmpName AS '0300-0400', EmpName AS '0400-0500', EmpName AS '0500-0600', EmpName AS '0600-0700', EmpName AS '0700-0800', EmpName AS '0800-0900', EmpName AS '0900-1000', EmpName AS '1000-1100', EmpName AS '1100-1200', FROM satsschema.employeeslot
WHERE LocationName = 'T2 PML'
and AllocationDate = '10-Aug'
and (EmpTime >= '00:00:00' and EmpTime <= '12:00:00')
上面的语句提示我这个错误,“您的 SQL 语法有错误,请查看与您的 MySQL 服务器版本相对应的手册以获取正确的语法以使用整洁的 'FROM satsschema.employeeslot WHERE LocationName = 'T2 PML' 和 AllocationDate = '在第 1 行。”
其次,除了输入所有内容之外,还有其他方法可以使这条线更短吗?
EmpName AS '0000-0100', EmpName AS '0100-0200', EmpName AS '0200-0300', EmpName AS '0300-0400', EmpName AS '0400-0500', EmpName AS '0500-0600', EmpName AS '0600-0700', EmpName AS '0700-0800', EmpName AS '0800-0900', EmpName AS '0900-1000', EmpName AS '1000-1100', EmpName AS '1100-1200', FROM satsschema.employeeslot
帮助将不胜感激。