sql query for update only year in row

example:

column: tgl1 (DATE FORMAT)

tgl1 = '2016-12-31' change to '2015-12-31'

then just run this query

UPDATE daftar_paket
SET tgl1=DATE_FORMAT(tgl1,'2015-%m-%d')
WHERE YEAR(tgl1) = 2016 AND MONTH(tgl1) = 12;

Fuck you bro!

Advertisements