Last active
August 29, 2015 13:56
-
-
Save rdsilver/9060283 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I want to be able to call this function with something like "SELECT test() FROM tableName" | |
I'm getting an error on line 8 when I try to make the function | |
DELIMITER $$ | |
CREATE FUNCTION test() | |
RETURNS TEXT | |
BEGIN | |
DECLARE max_id INT; | |
SET max_id = SELECT max(id); //Erroring | |
RETURN CONCAT('Max ID is', max_id, ' !'); | |
END; | |
$$ | |
DELIMITER ; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment