Skip to content
Advertisement

Select minute from CURTIME() in a sql query

I have a column with CURTIME() value. I want a query that selects the minute from the column with CURTIME() and copy the minute to another column.

Advertisement

Answer

You could use the minute function.

If you’re just querying it:

SELECT MINUTE(my_time_column) FROM mytable 

To save this value to another column:

UPDATE mytable
SET    my_minute_column = MINUTE(my_time_column);
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement