I have a database problem with MySQL I created a database with a table CustomerInfo
Every year i want to update kilometers plus 1000
For example the row 6 today should be updated to 7000 kilometers from 6000 and the date from 2013-08-06 to 2014-08-06
update database.CustomerInfo
set Kilometers = Kilometers + 1000
where date_add(Date, interval 1 year) = curdate();
This code isn't correct and the date update is missing
If i run query
select * from database.customerinfo where date_add(Date, interval 1 year) = curdate();
returns row 6
thanks for the help
Date update is missing since you are not updating the date
update database.CustomerInfo
set Kilometers = Kilometers + 1000, Date = curdate()
where date_add(Date, interval 1 year) = curdate();
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments