Reputation: 1021
I have one table with 30 fields(columns). I would like to get what fields were updated within 5 minutes.
Upvotes: 0
Views: 145
Reputation: 4601
You can write a trigger and check which columns were updated using
FOR EACH ROW BEGIN
SET @Cols = 'Updated Columns: ';
IF OLD.col1 <> NEW.col1 THEN
@Cols = CONCAT(@Cols, 'col1, ');
END IF;
IF OLD.col2 <> NEW.col2 THEN
@Cols = CONCAT(@Cols, 'col2, ');
END IF;
END
@cols will contain all the updated fields
Upvotes: 0
Reputation: 6147
You have to log the update details to another table and run a trigger while updating your table
Upvotes: 2