摘要:
讨人喜欢的 MySQL replace into 用法(insert into 的增强版)在向表中插入数据的时候,经常遇到这样的情况:1. 首先判断数据是否存在; 2. 如果不存在,则插入;3.如果存在,则更新。在 SQL Server 中可以这样处理: if not exists (select 1 from t where id = 1) insert into t(id, update_time) values(1, getdate()) else update t set update_time = getdate() where id = 1那么 MySQ... 阅读全文
posted @ 2013-11-16 15:24
天道酬勤,坚持!
阅读(365)
评论(0)
推荐(0)

浙公网安备 33010602011771号