回答編集履歴

2

訂正

2019/06/01 13:35

投稿

sazi
sazi

スコア25195

test CHANGED
@@ -24,7 +24,7 @@
24
24
 
25
25
  select 1 from weapons
26
26
 
27
- where id=1 and JSON_CONTAINS(item, cncat('[', i.id, ']'), '$.item_ids')
27
+ where id=1 and JSON_CONTAINS(item, concat('[', i.id, ']'), '$.item_ids')
28
28
 
29
29
  )
30
30
 

1

修正

2019/06/01 13:35

投稿

sazi
sazi

スコア25195

test CHANGED
@@ -22,7 +22,9 @@
22
22
 
23
23
  select * from items i where exists(
24
24
 
25
+ select 1 from weapons
26
+
25
- select 1 from weapons where id=1 and JSON_EXTRACT(item, '$.item_ids[*]')=i.id
27
+ where id=1 and JSON_CONTAINS(item, cncat('[', i.id, ']'), '$.item_ids')
26
28
 
27
29
  )
28
30