我尝试使用和IF语句时出现mySql查询错误

时间:2019-07-11 03:30:41

标签: mysql if-statement

我无法在MySQL查询中找到错误。

  

您的SQL语法有错误;检查手册   对应于您的MySQL服务器版本以使用正确的语法   在第10行的“”附近

当我移除时:

IF DAYOFWEEK(curdate()) BETWEEN 2 AND 6 THEN
END IF;

然后查询执行正常。

我尝试在IF语句中使用制表符/空格

CREATE EVENT UPLOADTASK
ON SCHEDULE EVERY '1' DAY
STARTS '2019-07-09 00:00:00'
DO
IF DAYOFWEEK(curdate()) BETWEEN 2 AND 6 THEN
  INSERT INTO TABLE1 VALUES
  (1,"TASK1",curdate()-1,NULL),
  (6.5,"TASK2",curdate()-1,NULL),
  (3.0,"TASK3",curdate()-1,NULL),
  (8,"TASK44",curdate()-1,NULL);
END IF;

1 个答案:

答案 0 :(得分:0)

static void Main(string[] args) { Parallel.Invoke( () => PrintTeacherDetails(), () => PrintStudentdetails() ); Console.ReadLine(); } private static void PrintTeacherDetails() { Singleton fromTeacher = Singleton.GetInstance; fromTeacher.PrintDetails("From Teacher"); } private static void PrintStudentdetails() { Singleton fromStudent = Singleton.GetInstance; fromStudent.PrintDetails("From Student"); } 包含在If块中

Begin End