日期:2014-05-16 浏览次数:20838 次
create table chat_content ( chat_content_id int(11) not null AUTO_INCREMENT, from_id int(11) not null, to_id int(11) not null, content text default NULL, chat_time datetime, primary key (chat_content_id), }
/*==============================================================*/
/* TRIGGER: chat_content_trig chat_content insert用 */
/*==============================================================*/
CREATE TRIGGER chat_content_trig after insert
ON chat_content FOR EACH ROW
BEGIN
update chat_content set chat_time =(select sysdate())
where chat_content_id=new.chat_content_id
END;