diff --git "a/data/2.MySQL\344\270\255\351\230\266/5.\345\255\220\346\237\245\350\257\242/4.EXISTS/exists.md" "b/data/2.MySQL\344\270\255\351\230\266/5.\345\255\220\346\237\245\350\257\242/4.EXISTS/exists.md" index bd7ae3e7e500a6416a5094271d6ba448dbaa6309..095e382017a95daa0b1d7280dc615b5d7a3e3b89 100644 --- "a/data/2.MySQL\344\270\255\351\230\266/5.\345\255\220\346\237\245\350\257\242/4.EXISTS/exists.md" +++ "b/data/2.MySQL\344\270\255\351\230\266/5.\345\255\220\346\237\245\350\257\242/4.EXISTS/exists.md" @@ -24,7 +24,7 @@ create table employee( ## 答案 ```sql -select id, name, dept +select id, name, dept from employee as o where not exists(select * from employee as i where o.dept = i.dept and post='assistant'); ``` @@ -40,21 +40,13 @@ where exists(select * from employee as i where o.dept = i.dept and post='assista ``` ### B - -```sql -select id, name, dept -from employee as o -where not exists(select * from employee as i where o.dept = i.dept and post='assistant'); -``` - -### C ```sql select id, name, dept from employee as o where 'assistant' != exists(select post from employee as i); ``` -### D +### C ```sql select id, name, dept