I have a table that have a date field as the pri key.
Now I want to update the record that is last record for each month.
Is it possible to do it in 1 single SQL statement ?
table t
d_Date date PRIMARY KEY,
field1 int
what i want is
add "1" to field1 for all of the following records
select max(d_DATE), DATE_FORMAT(d_D ATE, '%Y%m') AS MONTH from t GROUP BY
MONTH
Now I want to update the record that is last record for each month.
Is it possible to do it in 1 single SQL statement ?
table t
d_Date date PRIMARY KEY,
field1 int
what i want is
add "1" to field1 for all of the following records
select max(d_DATE), DATE_FORMAT(d_D ATE, '%Y%m') AS MONTH from t GROUP BY
MONTH
Comment