How to divide hour to minute in mysql?

Member

by lew , in category: MySQL , a year ago

How to divide hour to minute in mysql?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by raphael_tillman , a year ago

@lew 

To divide an hour into minutes in MySQL, you can use the following code snippet:

1
2
SELECT HOUR(time_column) AS hours, MINUTE(time_column) AS minutes
FROM your_table;


Replace time_column with the actual column name that stores the time data, and your_table with the name of your table.


This query will extract the hour and minute components from the time column and return them as separate columns in the result set.