1 year ago

#73427

test-img

Vivek

Is it possible to automatically update datetime for modify_on for any changes in table except few columns

ALTER TABLE app_user add column modifyon datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP

It works but for all columns and I want to exclude few column such as lastlogin, InvalidTryCount etc.

eg. if have 4 column a, b, c, d I want modify_on to work for a and b column but if there are any changes in c or d it should not automatically add timestamp in modify_on

mysql

sql

mysql-workbench

0 Answers

Your Answer

Accepted video resources