mysql5存储过程邪门问题 month这个参数没有用到,本来存储过程比这要长,我只是贴出了出错的部分 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 问题解决了,原来是输入参数的year和列名的Year混淆了(大小写不同),把原来的参数year和month改为para_year和para_month就好了mysql> Drop Procedure If Exists p_report;Query OK, 0 rows affected (0.00 sec)mysql>mysql> Delimiter forendmysql>mysql> Create Procedure p_report -> (In para_year Int, -> In para_month Int, -> In Id Char(10), -> Out status Int) -> Begin -> Select Year, -> Month, -> OfficeId, -> OnTimeRate -> From ReportByMonth -> Where OfficeId = Id And -> Year = para_year; -> -> End -> -> forendQuery OK, 0 rows affected (0.00 sec)mysql>mysql> Delimiter ;mysql>mysql> call p_report(2005,0,"1",@a);+------+-------+----------+------------+| Year | Month | OfficeId | OnTimeRate |+------+-------+----------+------------+| 2005 | 1 | 1 | 1 || 2005 | 2 | 1 | 3 || 2005 | 3 | 1 | 4 || 2005 | 4 | 1 | 5 || 2005 | 5 | 1 | 6 || 2005 | 6 | 1 | 7 || 2005 | 7 | 1 | 8 |+------+-------+----------+------------+7 rows in set (0.00 sec)Query OK, 0 rows affected (0.09 sec) 使用mysqli连接,只可以查询,不可以更新和插入 PHP+phpMyAdmini总是安装不好哪位高手来指点一下 mysql如何导入frm文件? 急,哪位师傅帮帮我,mysql启动不了 mysql删除不了的记录 郁闷,又是驱动包错误 紧急求助关于postgresql的问题,系统给出一个警告很烦人。都过来看看好吗,谢谢 mySQL安装成功,但不会使用@!@ MySQL误删除数据,如何恢复? SQLServer和MySQL的同步问题 求SQL一句(立等,急!!!!!!!!!!!!!!) 如何整合JbuilderX和MySql?
Query OK, 0 rows affected (0.00 sec)mysql>
mysql> Delimiter forend
mysql>
mysql> Create Procedure p_report
-> (In para_year Int,
-> In para_month Int,
-> In Id Char(10),
-> Out status Int)
-> Begin
-> Select Year,
-> Month,
-> OfficeId,
-> OnTimeRate
-> From ReportByMonth
-> Where OfficeId = Id And
-> Year = para_year;
->
-> End
->
-> forend
Query OK, 0 rows affected (0.00 sec)mysql>
mysql> Delimiter ;
mysql>
mysql> call p_report(2005,0,"1",@a);
+------+-------+----------+------------+
| Year | Month | OfficeId | OnTimeRate |
+------+-------+----------+------------+
| 2005 | 1 | 1 | 1 |
| 2005 | 2 | 1 | 3 |
| 2005 | 3 | 1 | 4 |
| 2005 | 4 | 1 | 5 |
| 2005 | 5 | 1 | 6 |
| 2005 | 6 | 1 | 7 |
| 2005 | 7 | 1 | 8 |
+------+-------+----------+------------+
7 rows in set (0.00 sec)Query OK, 0 rows affected (0.09 sec)