Original Post
I want to create a function that returns table. Could somebody tell me how to write the syntax?
DELIMITER $$
DROP FUNCTION IF EXISTS `test`.`Get2` $$
CREATE FUNCTION `test`.`Get2` () RETURNS myTable TABLE
(
index2 int,
)
AS
BEGIN
INSERT myTable
SELECT `index` FROM horsenpc WHERE `level`=9;
return myTable;
END $$
DELIMITER ;