linux mysql 创建存储过程_Mysql 不能在Linux下创建存储过程?

同样的存储过程代码,我放在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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值