create procedure TJZGS as select N_RYBH,sum(TIMEDIFF(D_XBSJ,D_SBSJ)) from T_RY_KQXX;
ERROR 1064(42000):You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'as select N_RYBH,sum(TIMEDIFF(D_XBSJ,D_SBSJ)) from T_RY_KQXX' at line 1
4 个解决方案
#1
参考一下MYSQL官方免费帮助中的例子。 没有 create procedure ... as .. 这种语法。
#2
create procedure TJZGS
begin
select N_RYBH,sum(TIMEDIFF(D_XBSJ,D_SBSJ)) from T_RY_KQXX
end;
#3
delimiter $$
create procedure TJZGS()
begin
select N_RYBH,sum(TIMEDIFF(D_XBSJ,D_SBSJ)) from T_RY_KQXX;
end;
delimiter ;
create procedure TJZGS()
begin
select N_RYBH,sum(TIMEDIFF(D_XBSJ,D_SBSJ)) from T_RY_KQXX;
end;
delimiter ;
#4
3L对了
#1
参考一下MYSQL官方免费帮助中的例子。 没有 create procedure ... as .. 这种语法。
#2
create procedure TJZGS
begin
select N_RYBH,sum(TIMEDIFF(D_XBSJ,D_SBSJ)) from T_RY_KQXX
end;
#3
delimiter $$
create procedure TJZGS()
begin
select N_RYBH,sum(TIMEDIFF(D_XBSJ,D_SBSJ)) from T_RY_KQXX;
end;
delimiter ;
create procedure TJZGS()
begin
select N_RYBH,sum(TIMEDIFF(D_XBSJ,D_SBSJ)) from T_RY_KQXX;
end;
delimiter ;
#4
3L对了