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

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

WBOY
Release: 2016-06-07 14:57:00
Original
1280 people have browsed it

自动更新日期列的值为最大日期的触发器 无 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)  
Copy after login
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template