回答編集履歴
1
chousei
answer
CHANGED
@@ -7,18 +7,18 @@
|
|
7
7
|
(3,'c'),
|
8
8
|
(4,'d');
|
9
9
|
|
10
|
-
create table articles_users(id int,user_id
|
10
|
+
create table articles_users(id int,user_id int,article_id int);
|
11
11
|
insert into articles_users values
|
12
|
+
(1,1,1),
|
12
|
-
(1,
|
13
|
+
(1,2,1),
|
13
|
-
(1,'b',1),
|
14
|
-
(1,
|
14
|
+
(1,3,2),
|
15
|
-
(1,
|
15
|
+
(1,4,2);
|
16
16
|
|
17
17
|
select * from users as t1
|
18
18
|
where exists(
|
19
19
|
select 1
|
20
20
|
from articles_users
|
21
|
-
where t1.
|
21
|
+
where t1.id=user_id
|
22
22
|
group by user_id
|
23
23
|
having sum(article_id=1)=0
|
24
24
|
);
|