解决方案 »
- 推荐个图形界面的mysql工具
- 【【【【请教大神,mysql读取count(id)后为0的不显示?求解】】】】
- 统计数据问题
- select t1.a, t1.b, t2.c, t2.d from t1, t2 while (t1.a = t2.a and t2.a = 5)
- 一个查询语句执行了1个小时多
- mysql数据库同步问题
- 如何在mysql下执行这个文件生成数据库?不用第三软件,
- EMS MySQL Manager 真是好东东!
- 如何把文本文件的数据直接导入mysql数据库?
- MySQL中 NOT NULL 约束问题
- windows下mysql 自动安装及配置
- 关于mysql系统内存占用过高的问题
过程不好实现
/*执行时去掉我的"--"*/
create trigger tri_t_terminal
after insert on t_terminal
for each row
begin
IF NEW.vodTypes is not null THEN --可以写多个字段
INSERT INTO t_sendmessagehis VALUES(NEW.TerminalID,NEW.VehicleID,NEW.OrganID);
END IF;
end;CREATE TABLE t_sendmessagehis(
TerminalID bigint(20) NOT NULL COMMENT '终端ID',
VehicleID int(11) DEFAULT NULL COMMENT '所属车辆ID',
OrganID int(11) DEFAULT NULL
)--vodTypes 无值 不触发
INSERT INTO t_terminal VALUES ('1000', null, '2', '2', null, '2014-03-12 14:10:23', null, '479', null, null, '26', null, 't1', null, null, null, null, null, '1', null, null, null, null, null, null, null, null);
--vodTypes 有值触发
INSERT INTO t_terminal VALUES ('1007', null, '2', '2', null, '2014-03-12 14:10:24', null, '486', null, null, '26', null, 't1', null, null, null, null, null, '1', 'abc', null, null, null, null, null, null, null);