meetpd
meetpd

Reputation: 9219

How to Update Date in each row with different dates in MySQL

I want to update date column of the table with dates in the increment of 1 for all rows.

How do I do it in MySQL?

Table: tbl_question_of_the_day

Table Columns: ID, Date, Text

So the output that I want is:

ID Date Text
1 26-May-21 Hello
2 27-May-21 How are you
3 28-May-21 Hello

Thanks!

Upvotes: 0

Views: 674

Answers (1)

TommyN
TommyN

Reputation: 2381

You could do something like:

update tbl_question_of_the_day set date = current_date + interval ID day

Upvotes: 1

Related Questions