关于存储过程里的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 怎样理解关系数据库中的“关系”二字 show variables like 'key_buffer_size'中得到的值 的单位是什么? 如何在存储过程中赋值? C插入Mysql vc6.0中用C API连接mysql一示例代码(语言是c++) read_last_with_key的错误 如何在mysql中设置标识列? 跪求:mysql存储过程的例子,带输入,输出参数的(5.0支持存储过程) 请叫这个sql语句 关于时间戳的一个问题 【开源】我开发的贴吧,先公开测试一下后台管理系统 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