I have created table by following
CREATE TABLE MyTable (
`MyTable_ID` int UNSIGNED NOT NULL AUTO_INCREMENT ,
CreationDate datetime NULL ,
UpdateDate` datetime NULL ,
PRIMARY KEY (`MyTable_ID`)
);
Here I have 2 columns CreationDate
and UpdateDate
.
I want to write only one trigger for both update and insert operation to update/ insert CreationDate, UpdateDate columns.
If I am doing
- insert operation I want to update CreationDate,UpdateDate columns
- if I am doing update operation I want to update only UpdateDate.
Thank you.