同样的存储过程代码,我放在windows上的Mysql 就可以执行,但是放到SUSE Linux 下执行却报语法错误,Mysql 版本都是5.0的,大虾们给看看啊,
SQL语句如下:
DROP PROCEDURE IF EXISTS `CREATE_MONTHLY_SALE`;
CREATE PROCEDURE `CREATE_MONTHLY_SALE`(in begindate varchar(10), in enddate varchar(10),in userid bigint(20))
begin
drop table if exists tb0;
create temporary table tb0(pcid0 bigint(20),userid0 bigint(20),month0 varchar(10),sum0 double) as select pc.id as pcid0, so.operatorId userid0,substring(begindate,1,7) month0,
sum(proitem.totalprice) sum0
from product pro,productitem proitem,productclass pc,
saleorder so where 1=1
and so.operatorId =userid
and (so.bargainDate between begindate and enddate)
and so.id=proitem.orderid
and proitem.productId=pro.id
and pro.pc=pc.id
group by pc.id;
end;
错误信息为:
ERROR 1064 (42000): You have an error in your SQL syntax;check the manual that corresponds to your MySQL server version for right syntax to use near 'create temporary table tb0(pcid0 bigint(20),userid0(bigint(20),month0 varchar(10),sum0 d' at line 3
2009年2月28日 10:28