尝试创建sql过程,使用concat获取错误

时间:2018-01-10 14:20:31

标签: mysql stored-procedures

DELIMITER $$

CREATE PROCEDURE selectContacts

BEGIN

SELECT master_id, CONCAT_WS(" ",l_name, f_name) AS display_name

FROM master_name

ORDER BY l_name, f_name;

END

错误:

#1064 - Something is wrong in your syntax obok 'BEGIN

SELECT master_id, CONCAT_WS(" ",l_name, f_name) AS display_name

FROM' at line 3

Unrecognized data type. (near " " at position 75)
Unrecognized data type. (near ")" at position 90)

无法识别的数据类型位于concat_ws的括号中。我不知道它在2个月前工作有什么问题。

1 个答案:

答案 0 :(得分:0)

创建语法不太正确可能只是一个错字。

CREATE PROCEDURE selectContacts()