nodejsj
nodejsj

Reputation: 555

mysql update value from another column in the same table

I have a table with these 2 columns : date and day date has dates and day is empty I would like to do something like this :

UPDATE table SET day='day(date)' 

the idea is to take the date (its in date time format) and take out the day and insert it into the day column. any ideas ?

Upvotes: 0

Views: 708

Answers (1)

Khrisna Gunanasurya
Khrisna Gunanasurya

Reputation: 745

Hope this will help

UPDATE table SET day = EXTRACT(DAY FROM date)

Upvotes: 1

Related Questions