LoginSignup
0
0

More than 3 years have passed since last update.

sqlで先頭が数字で始まる文字列を検索する

Posted at

正規表現を使って調べる

SELECT * FROM テーブル名 WHERE 調べたいカラム名 REGEXP '^[0-9]';

REGEXP以下をちょっと解説


・ ^   先頭の文字列を指定
・ []  []内のいずれかに一致
・ 0-9 0から9

つまり、文字列の先頭が0から9のいずれかに一致するものを検索する正規表現になる

下記を参考にすれば色々応用できます
正規表現を使ったパターンマッチングを行う(REGEXP演算子)

0
0
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
0
0