LoginSignup
1
1

More than 5 years have passed since last update.

ワイルドカードを使用してレコードを検索する(LIKE)

Posted at

文字列が完全に一致するかどうかを調べる際には、「=」 を使用します。LIKE は「=」をよりあいまいにしたものです。具体的には、LIKE を使用することにより、「○○と一致する」ではなく、「○○という文字が含まれている」という条件を作ることが出来ます。

特に使用頻度が高いのは、「%」を前後両方に付けて「%○○%」などとすることで、文字列のどこかに「○○」が含まれているものを検索する中間一致検索。

ワイルドカード 意味
% 0文字以上の任意の文字列
_ 任意の1文字
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