From c7952fd015dde21f2c4303dba1859d12d5d8c5c3 Mon Sep 17 00:00:00 2001 From: luxin Date: Tue, 26 Jul 2022 11:56:45 +0800 Subject: [PATCH] exercise bug fixed --- .../4.EXISTS/exists.md" | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) 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 bd7ae3e..095e382 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 -- GitLab