在一个自定义函数中:
select count(*) into holidays
from supervise_calendar
where cal_type='2'
and date_name between DATE_FORMAT(beginDate,'%Y-%m-%d') +interval 1 day and DATE_FORMAT(endDate,'%Y-%m-%d')- interval 1 day;不能把 count(*) 的值赋给 holidays
;
最好能在本sql语句中改!如果正确了马上给分
select count(*) into holidays
from supervise_calendar
where cal_type='2'
and date_name between DATE_FORMAT(beginDate,'%Y-%m-%d') +interval 1 day and DATE_FORMAT(endDate,'%Y-%m-%d')- interval 1 day;不能把 count(*) 的值赋给 holidays
;
最好能在本sql语句中改!如果正确了马上给分
from supervise_calendar
where cal_type='2'
and date_name between DATE_FORMAT(beginDate,'%Y-%m-%d') +interval 1 day and DATE_FORMAT(endDate,'%Y-%m-%d')- interval 1 day;你的SQL语句应该可以,holidays申明没有?
Query OK, 1 row affected (0.00 sec)mysql> select @temp;
+-------+
| @temp |
+-------+
| tt |
+-------+
1 row in set (0.00 sec)