declare quxian int;
select count(1) into c from com_area where areaName like '%quxian%';
报错了 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'select count(1) into c from com_area where areaName like '%'+quxian+'%';
' at line 11
select count(1) into c from com_area where areaName like '%quxian%';
报错了 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'select count(1) into c from com_area where areaName like '%'+quxian+'%';
' at line 11
select count(1) into @c from com_area where areaName like '%quxian%';
select @c;
' at line 11很显然你的语句并不是 where areaName like '%quxian%';
建议提问时尽量贴原语句。改成 select count(1) into c from com_area where instr(areaName,quxian);