Home >Database >Mysql Tutorial >自动更新日期列的值为最大日期的触发器

自动更新日期列的值为最大日期的触发器

WBOY
WBOYOriginal
2016-06-07 14:57:001276browse

自动更新日期列的值为最大日期的触发器 无 CREATE TRIGGER autosettimeasmaxON dbo.statusafter INSERT, UPDATEAS UPDATE dbo.status SET mytime = '9999-12-31 23:59:59.000' WHERE id IN(SELECT id FROM inserted)

自动更新日期列的值为最大日期的触发器
CREATE TRIGGER autosettimeasmax
ON dbo.status
after INSERT, UPDATE
AS
    UPDATE dbo.status
    SET    mytime = '9999-12-31 23:59:59.000'
    WHERE  id IN(SELECT id
                 FROM   inserted)  
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn