0
0

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 1 year has passed since last update.

MySQLにてカタカナをひらがなに一括置換

Posted at
UPDATE table_name SET column_name = REPLACE(column_name, "ア", "あ");
UPDATE table_name SET column_name = REPLACE(column_name, "イ", "い");
UPDATE table_name SET column_name = REPLACE(column_name, "ウ", "う");
UPDATE table_name SET column_name = REPLACE(column_name, "エ", "え");
UPDATE table_name SET column_name = REPLACE(column_name, "オ", "お");

UPDATE table_name SET column_name = REPLACE(column_name, "ァ", "ぁ");
UPDATE table_name SET column_name = REPLACE(column_name, "ィ", "ぃ");
UPDATE table_name SET column_name = REPLACE(column_name, "ゥ", "ぅ");
UPDATE table_name SET column_name = REPLACE(column_name, "ェ", "ぇ");
UPDATE table_name SET column_name = REPLACE(column_name, "ォ", "ぉ");

UPDATE table_name SET column_name = REPLACE(column_name, "カ", "か");
UPDATE table_name SET column_name = REPLACE(column_name, "キ", "き");
UPDATE table_name SET column_name = REPLACE(column_name, "ク", "く");
UPDATE table_name SET column_name = REPLACE(column_name, "ケ", "け");
UPDATE table_name SET column_name = REPLACE(column_name, "コ", "こ");

UPDATE table_name SET column_name = REPLACE(column_name, "ガ", "が");
UPDATE table_name SET column_name = REPLACE(column_name, "ギ", "ぎ");
UPDATE table_name SET column_name = REPLACE(column_name, "グ", "ぐ");
UPDATE table_name SET column_name = REPLACE(column_name, "ゲ", "げ");
UPDATE table_name SET column_name = REPLACE(column_name, "ゴ", "ご");

UPDATE table_name SET column_name = REPLACE(column_name, "サ", "さ");
UPDATE table_name SET column_name = REPLACE(column_name, "シ", "し");
UPDATE table_name SET column_name = REPLACE(column_name, "ス", "す");
UPDATE table_name SET column_name = REPLACE(column_name, "セ", "せ");
UPDATE table_name SET column_name = REPLACE(column_name, "ソ", "そ");

UPDATE table_name SET column_name = REPLACE(column_name, "ザ", "ざ");
UPDATE table_name SET column_name = REPLACE(column_name, "ジ", "じ");
UPDATE table_name SET column_name = REPLACE(column_name, "ズ", "ず");
UPDATE table_name SET column_name = REPLACE(column_name, "ゼ", "ぜ");
UPDATE table_name SET column_name = REPLACE(column_name, "ゾ", "ぞ");

UPDATE table_name SET column_name = REPLACE(column_name, "タ", "た");
UPDATE table_name SET column_name = REPLACE(column_name, "チ", "ち");
UPDATE table_name SET column_name = REPLACE(column_name, "ツ", "つ");
UPDATE table_name SET column_name = REPLACE(column_name, "テ", "て");
UPDATE table_name SET column_name = REPLACE(column_name, "ト", "と");
UPDATE table_name SET column_name = REPLACE(column_name, "ッ", "っ");

UPDATE table_name SET column_name = REPLACE(column_name, "ダ", "だ");
UPDATE table_name SET column_name = REPLACE(column_name, "ヂ", "ぢ");
UPDATE table_name SET column_name = REPLACE(column_name, "ヅ", "づ");
UPDATE table_name SET column_name = REPLACE(column_name, "デ", "で");
UPDATE table_name SET column_name = REPLACE(column_name, "ド", "ど");


UPDATE table_name SET column_name = REPLACE(column_name, "ナ", "な");
UPDATE table_name SET column_name = REPLACE(column_name, "ニ", "に");
UPDATE table_name SET column_name = REPLACE(column_name, "ヌ", "ぬ");
UPDATE table_name SET column_name = REPLACE(column_name, "ネ", "ね");
UPDATE table_name SET column_name = REPLACE(column_name, "ノ", "の");

UPDATE table_name SET column_name = REPLACE(column_name, "ハ", "は");
UPDATE table_name SET column_name = REPLACE(column_name, "ヒ", "ひ");
UPDATE table_name SET column_name = REPLACE(column_name, "フ", "ふ");
UPDATE table_name SET column_name = REPLACE(column_name, "ヘ", "へ");
UPDATE table_name SET column_name = REPLACE(column_name, "ホ", "ほ");

UPDATE table_name SET column_name = REPLACE(column_name, "バ", "ば");
UPDATE table_name SET column_name = REPLACE(column_name, "ビ", "び");
UPDATE table_name SET column_name = REPLACE(column_name, "ブ", "ぶ");
UPDATE table_name SET column_name = REPLACE(column_name, "ベ", "べ");
UPDATE table_name SET column_name = REPLACE(column_name, "ボ", "ぼ");

UPDATE table_name SET column_name = REPLACE(column_name, "パ", "ぱ");
UPDATE table_name SET column_name = REPLACE(column_name, "ピ", "ぴ");
UPDATE table_name SET column_name = REPLACE(column_name, "プ", "ぷ");
UPDATE table_name SET column_name = REPLACE(column_name, "ペ", "ぺ");
UPDATE table_name SET column_name = REPLACE(column_name, "ポ", "ぽ");

UPDATE table_name SET column_name = REPLACE(column_name, "マ", "ま");
UPDATE table_name SET column_name = REPLACE(column_name, "ミ", "み");
UPDATE table_name SET column_name = REPLACE(column_name, "ム", "む");
UPDATE table_name SET column_name = REPLACE(column_name, "メ", "め");
UPDATE table_name SET column_name = REPLACE(column_name, "モ", "も");

UPDATE table_name SET column_name = REPLACE(column_name, "ヤ", "や");
UPDATE table_name SET column_name = REPLACE(column_name, "ユ", "ゆ");
UPDATE table_name SET column_name = REPLACE(column_name, "ヨ", "よ");
UPDATE table_name SET column_name = REPLACE(column_name, "ャ", "ゃ");
UPDATE table_name SET column_name = REPLACE(column_name, "ュ", "ゅ");
UPDATE table_name SET column_name = REPLACE(column_name, "ョ", "ょ");

UPDATE table_name SET column_name = REPLACE(column_name, "ラ", "ら");
UPDATE table_name SET column_name = REPLACE(column_name, "リ", "り");
UPDATE table_name SET column_name = REPLACE(column_name, "ル", "る");
UPDATE table_name SET column_name = REPLACE(column_name, "レ", "れ");
UPDATE table_name SET column_name = REPLACE(column_name, "ロ", "ろ");

UPDATE table_name SET column_name = REPLACE(column_name, "ワ", "わ");
UPDATE table_name SET column_name = REPLACE(column_name, "ヲ", "を");
UPDATE table_name SET column_name = REPLACE(column_name, "ン", "ん");

ぱっと調べたところ、これだ!というサンプルが無かったので備忘がてら。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?