记录一次mysql插入数据的操作,要先判断表中是否存在对应的值。 以往我们的操作都是先select,再insert,今天给大家分享另一种操作,一条sql语句来实现: inset into user(username)select '123456' from dual where not EXISTS (select username from user where username='123456') 如遇到问题欢迎进群308742428 喜欢的朋友可以关注下。