CREATE DEFINER=root
@%
PROCEDURE p_cur_date_canteen_data_wx
(p_date varchar(50))
BEGIN
if p_date = '' then
set p_date=date_format(now(),'%Y-%m-%d');
end if;
select t.typeName,sum( if( o.state = 1 or o.state=2,1,0 ) ) as dcrs ,sum( if( o.state=3,1,0 ) ) as wdcqcrs ,sum( if( o.state > 1,1,0 ) ) as yqcrs ,sum( if( o.state = 1,1,0 ) ) as wqcrs
from t_order o left join t_order_type t on o.orderTypeUuid=t.uuid
where o.orderDate = p_date group by o.orderTypeUuid order by t.xh;
END
这是存储过程已经创建成功!
但使用call p_cur_date_canteen_data_wx('2019-07-01'); 查询 报错:
**[SQL] call p_cur_date_canteen_data_wx('2019-07-01');
[Err] 1055 -
**
请问是什么问题?