DELIMITER //
drop procedure if exists queryMonthData;
create procedure queryMonthData(IN time varchar(20))
begin
select * from bsmu_powerandconfig_info where SaveTime like concat(time, '%') order by SaveTime desc limit 1;
select * from bsmu_powerandconfig_info where SaveTime like concat(time, '%') order by SaveTime asc limit 1;
end //
drop procedure if exists queryMonthData;
create procedure queryMonthData(IN time varchar(20))
begin
select * from bsmu_powerandconfig_info where SaveTime like concat(time, '%') order by SaveTime desc limit 1;
select * from bsmu_powerandconfig_info where SaveTime like concat(time, '%') order by SaveTime asc limit 1;
end //
DELIMITER ;
用concat解决问题