Hi..
Below is my code to create function called get_first_record and get_last record.
Code:
CREATE FUNCTION get_first_record (tab varchar(20))
RETURNS VARCHAR(20)
BEGIN
RETURN select FieldID9 from tab order by FieldID1 asc limit 1;
END;
CREATE FUNCTION get_last_record (tab varchar(20))
RETURNS VARCHAR(20)
BEGIN
RETURN select FieldID9 from tab order by FieldID1 desc limit 1;
END;
But i got an error as below:-
MySQL Database Error: 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 'select FieldID9 from tab order by FieldID1 asc limit 1;
END' at line 4
Could somebody help me ?..
Thank you,
Baharin