MariaDB MINUTE() Function
In MariaDB, MINUTE() is a built-in function that extracts and returns the minutes portion of a given time expression.
MariaDB MINUTE() Syntax
This is the syntax of the MariaDB MINUTE() function:
MINUTE(time)
Parameters
time-
Required. A time or datetime expression.
If you supply the wrong number of arguments, MariaDB will report an error: ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ' '06:30:45').
Return value
The MariaDB MINUTE() function extracts and returns the minute part of a gaven time, and the return value of the MINUTE() function is between 0 and 59.
If the argument is NULL, the MINUTE() function will return NULL.
MariaDB MINUTE() Examples
This statement shows the basic usage of the MariaDB MINUTE() function:
SELECT
MINUTE('10:11:12'),
MINUTE('2023-02-28 10:11:12'),
MINUTE(NOW());
Output:
+--------------------+-------------------------------+---------------+
| MINUTE('10:11:12') | MINUTE('2023-02-28 10:11:12') | MINUTE(NOW()) |
+--------------------+-------------------------------+---------------+
| 11 | 11 | 4 |
+--------------------+-------------------------------+---------------+Conclusion
In MariaDB, MINUTE() is a built-in function that extracts and returns the minutes portion of a given time expression.