Function calls are very cheap compared to access any table. Internal functions are cheapest.

On Thu, 29 Jun 2023, 7:49 am manpritsinghece--- via discuss, <discuss@lists.mariadb.org> wrote:
This is something learning by doing. What about this function

CREATE FUNCTION second_largest(x INT, y INT, z INT) RETURNS INT DETERMINISTIC
    RETURN  x+y+z - LEAST(x, y, z) - GREATEST(x, y, z);

See i believe in code clarity, although this seems using two function calls inside my function . may be expensive in terms of time, but is more clear .
_______________________________________________
discuss mailing list -- discuss@lists.mariadb.org
To unsubscribe send an email to discuss-leave@lists.mariadb.org