mysql自定义函数怎么写?
mysql> CREATE FUNCTION HelloWorld4()
-> RETURNS VARCHAR(20)
-> BEGIN
-> RETURN 'Hello World!';
-> END;
-> //
Query OK, 0 rows affected (0.00 sec)
mysql> select HelloWorld4() //
+---------------+
| HelloWorld4() |
+---------------+
| Hello World! |
+---------------+
1 row in set (0.00 sec) ...展开mysql> CREATE FUNCTION HelloWorld4()
-> RETURNS VARCHAR(20)
-> BEGIN
-> RETURN 'Hello World!';
-> END;
-> //
Query OK, 0 rows affected (0.00 sec)
mysql> select HelloWorld4() //
+---------------+
| HelloWorld4() |
+---------------+
| Hello World! |
+---------------+
1 row in set (0.00 sec)