mysql - MariaDB服务器版本上参数错误的SQL存储过程LIKE操作
问题描述
我想使用 LIKE 操作创建存储过程,但出现错误并且我看到的答案* *对于当前版本来说已经过时了。我怎样才能正确编写程序
得到同样的错误:你的 SQL 语法有错误;查看与您的 MariaDB 服务器版本相对应的手册,了解在 'LIKE '%' + @Name + '%' AND 附近使用的正确语法;brand
LIKE '%' + @Brand+ '%' AND; 第 2 行的“描述”
试过这些:
BEGIN
`name` LIKE '%' + @Name + '%' AND
`brand` LIKE '%' + @Brand+ '%' AND
`description` LIKE '%' + @Desc + '%' AND
`type` LIKE '%' + @Type + '%';
END
BEGIN
`name` LIKE CONCAT('%', @Name, '%') AND
`brand` LIKE CONCAT('%', @Brand, '%') AND
`description` LIKE CONCAT('%', @Desc, '%') AND
`type` LIKE CONCAT('%', @Type, '%');
END
文档:https ://dev.mysql.com/doc/refman/5.7/en/create-procedure.html
解决方案
推荐阅读
- javascript - 内容类型八位字节流并在后端处理它
- angular - 等待 http req 单元完成角度(服务)
- html - 将自定义 css 添加到树枝模板,样式不适用
- angular - 角度 6 HttpInterceptor 未触发
- r - 为 ggplot facet_wrap 设置数据
- sql - 检查亚马逊Athena / Presto中两个间隔是否重叠的方法
- vba - Powerpoint - 通过 VBA 将组保存为图像
- android - 您的应用尚未获准加入亲子同乐,并且更新未在 Google Play 上发布
- php - 从 created_at 字段获取日期和时间
- git - 从 Bitbucket 克隆存储库的特定文件夹