Home > Database > Mysql Tutorial > sqllite 判断 某个id是否存在于表中了,如果存在则不插入,不存

sqllite 判断 某个id是否存在于表中了,如果存在则不插入,不存

WBOY
Release: 2016-06-07 14:57:27
Original
2908 people have browsed it

判断某个id是否存在于表中了,如果存在则不插入,不存在则插入 无 INSERT INTO USER (email,ADDTIME) (SELECT 'email','addTime' FROM USER u2 JOIN( SELECT COUNT(*) num FROM USER u1 WHERE u1.id = 87) u3 ON u3.num 1 LIMIT 1)

判断 某个id是否存在于表中了,如果存在则不插入,不存在则插入
INSERT INTO USER (email,ADDTIME) (SELECT 'email','addTime' FROM USER u2  JOIN( SELECT COUNT(*) num FROM USER u1 WHERE u1.id = 87) u3 ON u3.num < 1  LIMIT 1)
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template