首页 > 代码库 > msyql

msyql

一个表中如果有 则更新 status字段  和 filename 字段,没有则 新增

 

INSERT INTO ec_file (updatetime, createtime, filesize, bucketname, filename, filetype , filepath )

VALUES (‘2016-08-08 12:12:12‘,‘2016-09-08 12:12:12‘,0, "huowulian","aaaaa","33", "photo/2016/12/06/1_123455_A1_951357_01_20161206101536_3924.jpg")

ON DUPLICATE KEY UPDATE status = "1", filename="cccc"

msyql