From 3a3bb594e4973223ddb3cf43069795dcd1e39d6f Mon Sep 17 00:00:00 2001 From: Mars Liu Date: Mon, 6 Feb 2023 14:40:21 +0800 Subject: [PATCH] fixed a typo --- .../4.EXISTS/exists.md" | 14 +++++++------- 1 file changed, 7 insertions(+), 7 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 9753b51..bb12cc3 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,12 +24,12 @@ create table employee( ## 答案 ```sql -select id, name, dept +select id, name, dept_id from employee as o where not exists( select * from employee as i - where o.dept = i.dept and post='assistant'); + where o.dept_id = i.dept_id and post='assistant'); ``` ## 选项 @@ -37,17 +37,17 @@ where not exists( ### A ```sql -select id, name, dept +select id, name, dept_id from employee as o where exists( select * from employee as i - where o.dept = i.dept and post='assistant'); + where o.dept_id = i.dept_id and post='assistant'); ``` ### B ```sql -select id, name, dept +select id, name, dept_id from employee as o where 'assistant' != exists( select post @@ -57,10 +57,10 @@ where 'assistant' != exists( ### C ```sql -select id, name, dept +select id, name, dept_id from employee as o where 'assistant' = not exists( select post from employee as i - where o.dept = i.dept); + where o.dept_id = i.dept_id); ``` \ No newline at end of file -- GitLab