关于存储过程里的datetime比较 大家好,谁能帮忙写一个简单的存储过程。传入参数datetime a 和 int key从table中根据key选出一条记录,key是pk,这条记录中b也是datetime类型。将a和b做对比,如果b晚于a,则执行特定insert 语句,否则执行update语句。非常感谢 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 create procedure sp_test(a1 datetime ,key1 int)begindeclae temp datetime;select b into temp from table where key=key1;if timestampdiff(s,a,b)>0 then insert into xxxx; else update xxx;end if;end 新建表格,合并表格 mysql C API创建存储过程 MySql——Front是否有设置主键的功能 sql能否做到下面例子的link 请问在mysql中有无根据2条SQL语句的结果进行分页的方法 怎么设置能使一个DATETIME型的字段,插入新数据时自动为当前日期时间? 为什么MYSQL使用视图查询2w条数据中其中1天的数据都要1S呢? grant 求助,mysql update更新数据太慢了 mysql与Java连接 【开源】我开发的贴吧,先公开测试一下后台管理系统 mysql5.2+linux+asp.net RPM安装MYSQL没有用
begin
declae temp datetime;
select b into temp from table where key=key1;
if timestampdiff(s,a,b)>0 then
insert into xxxx;
else
update xxx;
end if;
end