回答編集履歴

1

chousei

2020/06/09 12:32

投稿

yambejp
yambejp

スコア116730

test CHANGED
@@ -16,17 +16,17 @@
16
16
 
17
17
 
18
18
 
19
- create table articles_users(id int,user_id varchar(10),article_id int);
19
+ create table articles_users(id int,user_id int,article_id int);
20
20
 
21
21
  insert into articles_users values
22
22
 
23
- (1,'a',1),
23
+ (1,1,1),
24
24
 
25
- (1,'b',1),
25
+ (1,2,1),
26
26
 
27
- (1,'c',2),
27
+ (1,3,2),
28
28
 
29
- (1,'d',2);
29
+ (1,4,2);
30
30
 
31
31
 
32
32
 
@@ -38,7 +38,7 @@
38
38
 
39
39
  from articles_users
40
40
 
41
- where t1.name=user_id
41
+ where t1.id=user_id
42
42
 
43
43
  group by user_id
44
44