1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

OracleDBでの大文字小文字を区別しないlike検索について

Posted at

Oracle11gで、大文字-小文字を区別しないlike検索をしたい

結論

select col_1
from tbl
where UPPER(col_1) = UPPER('%joken%')
;

または

select col_1
from tbl
where REGEXP_LIKE(col_1, 'joken', 'i')
;

のいずれか。

REGEXP_LIKE - Oracle SQL 関数リファレンス

注意

UPPER()LOWER()またはREGEXP_LIKE()を使うとfull scanになる。
そのため、index scanを実行できる曖昧検索は、大文字小文字を区別する前方一致の検索のみである。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?