回答編集履歴

2

修正

2019/10/28 05:41

投稿

sazi
sazi

スコア25327

test CHANGED
@@ -26,7 +26,7 @@
26
26
 
27
27
  select 1 from tbl
28
28
 
29
- where key1 = like substr(t.key1, 1, 2) || '%'
29
+ where key1 like substr(t.key1, 1, 2) || '%'
30
30
 
31
31
  and array[key1, key2, key3]::text[] > array[t.key1, t.key2, t.key3]::text[]
32
32
 

1

訂正

2019/10/28 05:41

投稿

sazi
sazi

スコア25327

test CHANGED
@@ -26,7 +26,7 @@
26
26
 
27
27
  select 1 from tbl
28
28
 
29
- where substr(key1, 1, 2) = substr(t.key1, 1, 2)
29
+ where key1 = like substr(t.key1, 1, 2) || '%'
30
30
 
31
31
  and array[key1, key2, key3]::text[] > array[t.key1, t.key2, t.key3]::text[]
32
32