MySQL update just day in date column in many rows

Luis

Having this rows:

1|2015-04-22
2|2015-03-11
3|2015-02-15

I want update on all rows just the day, example:

1|2015-04-25
2|2015-03-25
3|2015-02-25
O. Jones

It looks like you want to keep the year and month the same, and change all the days to the 25th of whichever year and month are shown.

The formula you need is

DATE(DATE_FORMAT(datecolumn, '%Y-%m-25'))

So, to update the table it's

UPDATE mytable SET datecolumn =  DATE(DATE_FORMAT(datecolumn, '%Y-%m-25'))

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to update mysql date column field with the next working day.?

From Dev

Convert many column into multiple columns and rows in mysql

From Dev

mysql and c# - compare date with today (just the day)

From Dev

update time to date-time column in MySQL

From Dev

MySQL Update Value of column Based on DATE

From Dev

Update Date column with adding 10 days in mysql

From Dev

Does Persisted Computed Column need to update all rows or just affected rows?

From Dev

mysql random update date column between two date with condition

From Dev

Transforming date column from year-month-day to just year-month

From Dev

how to update all rows based on specific date by a single mysql query

From Dev

MySQL - After Update Trigger on Specific Column affects all rows in the table

From Dev

MySQL - Update rows where value in column is the same as previous row

From Dev

Mysql update all rows value with count of same table column

From Dev

MySQL query to update multiple rows based on a column using php

From Dev

MySQL: Update column of multiple rows based on another row

From Dev

Mysql - update column from another table data without reducing rows

From Dev

How to UPDATE MySQL Rows with other values in the same column?

From Dev

MySQL rows matched: 1 changed: 0 warnings: 0 for date column

From Dev

MYSQL return zero in date not present, and COUNT how many rows are present with a specific date

From Dev

Expand Column to many rows in Scala

From Dev

update table rows by just clicking on them

From Dev

How to create something to update end date by starting day and duration column automaticly SQL

From Dev

Group and display MYSQL rows by day?

From Dev

MySQL Python update rows

From Dev

UPDATE mysql rows

From Dev

Mysql - Rows to Columns on date

From Dev

Remove duplicate rows on many to many table (Mysql)

From Dev

many to many query mysql return duplicate rows

From Dev

Remove duplicate rows on many to many table (Mysql)

Related Related

  1. 1

    How to update mysql date column field with the next working day.?

  2. 2

    Convert many column into multiple columns and rows in mysql

  3. 3

    mysql and c# - compare date with today (just the day)

  4. 4

    update time to date-time column in MySQL

  5. 5

    MySQL Update Value of column Based on DATE

  6. 6

    Update Date column with adding 10 days in mysql

  7. 7

    Does Persisted Computed Column need to update all rows or just affected rows?

  8. 8

    mysql random update date column between two date with condition

  9. 9

    Transforming date column from year-month-day to just year-month

  10. 10

    how to update all rows based on specific date by a single mysql query

  11. 11

    MySQL - After Update Trigger on Specific Column affects all rows in the table

  12. 12

    MySQL - Update rows where value in column is the same as previous row

  13. 13

    Mysql update all rows value with count of same table column

  14. 14

    MySQL query to update multiple rows based on a column using php

  15. 15

    MySQL: Update column of multiple rows based on another row

  16. 16

    Mysql - update column from another table data without reducing rows

  17. 17

    How to UPDATE MySQL Rows with other values in the same column?

  18. 18

    MySQL rows matched: 1 changed: 0 warnings: 0 for date column

  19. 19

    MYSQL return zero in date not present, and COUNT how many rows are present with a specific date

  20. 20

    Expand Column to many rows in Scala

  21. 21

    update table rows by just clicking on them

  22. 22

    How to create something to update end date by starting day and duration column automaticly SQL

  23. 23

    Group and display MYSQL rows by day?

  24. 24

    MySQL Python update rows

  25. 25

    UPDATE mysql rows

  26. 26

    Mysql - Rows to Columns on date

  27. 27

    Remove duplicate rows on many to many table (Mysql)

  28. 28

    many to many query mysql return duplicate rows

  29. 29

    Remove duplicate rows on many to many table (Mysql)

HotTag

Archive