mariadb datetime change to microseconds 1

mariadb datetime change to microseconds

create function example(x datetime(5)) returns time(4)
begin
  declare y timestamp(6);
  return cast(x as time(2));
end;

Here is what the above code is Doing:
1. Create a function called example that takes a datetime(5) as an argument and returns a time(4)
2. Declare a variable called y that is a timestamp(6)
3. Return the cast of x as a time(2)

Similar Posts