MINUTE Function - SQL


Overview


The MINUTE function in SQL extracts the minute part from a time or datetime expression. It is useful for retrieving the minute component of a time.

Example:

SELECT MINUTE('2000-01-01 07:12:33')

Syntax:

SELECT MINUTE(time)

time is the time or datetime from which you want to extract the minute.


Example: Time Hard-coded value


In this example, we are returning the hour for the time ‘07:12:33,’ for a final output of 12.


Example: Datetime Hard-coded value


In this example, we are returning the hour for the datetime ‘2000-01-01 07:12:33,’ for a final output of 12.