EXISTS 运算符用于判断查询子句是否有记录,如果有一条或多条记录存在返回 True,否则返回 False。
SQL EXISTS 语法
SELECT column_name(s) FROM table_name WHERE EXISTS (SELECT column_name FROM table_name WHERE condition)
https://www.nowcoder.com/practice/153c8a8e7805400ba8e384e03acc6b3e?tpId=82&tags=&title=&difficulty=0&judgeStatus=0&rp=1
insert into actor (actor_id,first_name,last_name,last_update)
select '3','ED','CHASE','2006-02-15 12:34:33'
where not exists(
select * from actor where actor_id = '3')