I need to select the first flight of today. For that I'm using
delimiter//
CREATE function get_flightID(flightident())
returns int
begin
return (SELECT * FROM flightdep where depday = dayofweek(CURDATE()) ORDER BY depTime asc LIMIT 1;)
end//
delimiter;
But this isn't working. When I execute this I got an error about MySQL syntax.
17:50:50 ) end// delimiter 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 ') end// delimiter' at line 1 0.000 sec
I'm really guessing what to use in my first line, I tried everything I could think of.
CREATE function get_flightID(flightident())