タグ

関連タグで絞り込む (1)

タグの絞り込みを解除

sqlと都道府県に関するgouei2001のブックマーク (1)

  • 県コードを都道府県文字列に変更するSQL at softelメモ

    問題 データベースで都道府県を県コードで持っていたのですが、都道府県名にすることになりました。 データベースの県コードを都道府県名に変換するには? 答え こんな感じでどうでしょう。 update <対象のテーブル> set <対象のカラム> = case <対象のカラム> when 1 then '北海道' when 2 then '青森県' when 3 then '岩手県' when 4 then '宮城県' when 5 then '秋田県' when 6 then '山形県' when 7 then '福島県' when 8 then '茨城県' when 9 then '栃木県' when 10 then '群馬県' when 11 then '埼玉県' when 12 then '千葉県' when 13 then '東京都' when 14 then '神奈川県' when

    県コードを都道府県文字列に変更するSQL at softelメモ
  • 1