无法在mysql中创建视图

时间:2019-04-30 03:56:38

标签: mysql

我正在尝试创建视图并出现错误,请帮助我。

create view event as (
 SELECT *, TIMEDIFF(new.Event.newdatetimefield, t2.newdatetimefield),TIME_TO_SEC(TIMEDIFF(new.Event.newdatetimefield, t2.newdatetimefield)),IF(TIME_TO_SEC(TIMEDIFF(new.Event.newdatetimefield, 
 t2.newdatetimefield))>'300','TRUE','FALSE') AS status 
 FROM new.Event LEFT JOIN new.Event AS t2 ON t2.ID = new.Event.ID - 1);

错误是

  

错误代码:1060。重复的列名“ ID”

0 个答案:

没有答案