首页 > 数据库技术 > 详细

mysql语句插入前判断数据是否重复

时间:2019-03-05 17:33:36      阅读:742      评论:0      收藏:0      [点我收藏+]

在mysql中插入数据有时需要判断数据插入是否重复

语句编写:insert into 表(相应字段) select 相应字段 from dual where not exists (select 相应字段 from 表 where 相应查询条件)

eg:技术分享图片

 

mysql语句插入前判断数据是否重复

原文:https://www.cnblogs.com/nongfusanquan/p/10477909.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!