MySQL add few column exception for TRIGGER UPDATE FOR EACH ROW How to effectively add column id, name exception for trigger:

CREATE TRIGGER updated BEFORE UPDATE ON table1 FOR EACH ROW SET NEW.date=NOW()


so that date=NOW() will be affected on updating any column except id and name?
It's hard to give you an exact answer without knowing what RDBMS you are using or what your table schema looks like. But here is an example for SQL Server.

CREATE TRIGGER dbo.TR_MYTABLE_UPDATESTAMP
ON  dbo.[MYTABLE]
AFTER INSERT,UPDATE
AS 
BEGIN
    SET NOCOUNT ON;

    UPDATE I SET I.[MyTableUpdateDate] = GETDATE(), I.[MyTableUpdateBy] = SYSTEM_USER
    FROM INSERTED I
    INNER JOIN [MyTable] T ON T.MyTableId = I.MyTableId
    WHERE IsNull(T.[NumericColumnA], 0) &lt;&gt; IsNull(I.[NumericColumnA], 0)
    OR IsNull(T.[StringColumnB], '') &lt;&gt; IsNull(I.[StringColumnB], '')
    OR IsNull(T.[DateColumnC], '01-01-1950 00:00:00') &lt;&gt; IsNull(I.[DateColumnC], '01-01-1950 00:00:00')
END
GO