Mấy bro cho mình hỏi một chút về cấu trúc function trong MySQL, mình tạo 1 function đơn giản như sau:
CREATE FUNCTION fn_NewValue(@myinput NVARCHAR(30))
RETURNS NVARCHAR(30)
BEGIN
IF @myinput IS NULL
SET @myinput = 'Not Applicable'
RETURN @myinput
END
thì mysql nó báo lỗi là:
Error Code : 1064
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 '@myinput nvarchar(30))
RETURNS nvarchar(30)
BEGIN
IF @myinput IS NULL
SET @myinp' at line 1
Mong mấy bro chỉ giúp mình bị lỗi chỗ nào. Thanks!
Bookmarks