delimiter //
create procedure ProductViewAllByName(p_productName longtext)
begin
select productId as 'Product Code',
productName as 'Name',
productGroupId as 'Group ID',
manufactureId as 'Manufacture ID',
stockMinimunLevel as 'Stock Minimum Level',
stockMaximimLevel as 'Stock Maximum Level',
description as 'Description',
unitId as 'Unit ID'
FROM tbl_Product
where productName like p_productName+'%' ;
end //
delimiter ;
1064 - 您的SQL语法出错;检查与MySQL服务器版本对应的手册,以便在'+'%'附近使用正确的语法;在第12行结束
答案 0 :(得分:1)
也许你可以用CONCAT()函数
来做where productName like CONCAT(p_productName , '%');
答案 1 :(得分:1)
用以下内容替换where条件:
where productName like CONCAT(p_productName, '%')