I have table structure like this
id start_date during
1 2018-01-01 2
2 2018-01-02 3
And then I would like to add a new column named end_date using my query
SELECT 'start_date' + INTERVAL ('during')day as 'end_date'
then the result become end_date
end_date
2018-01-03
2018-01-05
I would like to add a new column in my table named end_date and then insert the data by query before. After I create the new column in my table, I did the query below to insert
INSERT INTO table_name(end_date)
SELECT 'start_date' + INTERVAL ('during')day
but the table gonna like this
id start_date during end_date
1 2018-01-01 2 null
2 2018-01-02 3 null
3 null null 2018-01-03
4 null null 2018-01-05
UPDATE(notINSERT).INSERTnew rows, but toUPDATEexisting ones by adding values to a new column...