i have one column (vedu_time) in "YYYY-MM-DD HH:MM:SS" format, i required new column (ganta_time)(new) having only HH:MM:SS for all my records at a time.
Please suggest the query.
vedu_time | ganta_time --> New column
--------------------|------------
2021-12-01 07:12:30 | 07:12:30
2021-12-01 07:20:44 | 07:20:44
2021-12-01 13:11:26 | 13:11:26
2
Answers
there is a function called
time()
will take the time and set it into the gana_time column for all your rows in that table.
You can use
date_format
and put that value in your insert or update query.Output:
15:03:23