トリガー を定義します テーブルの上:
CREATE TRIGGER lcase_insert BEFORE INSERT ON my_table FOR EACH ROW
SET NEW.language = LOWER(NEW.language);
CREATE TRIGGER lcase_update BEFORE UPDATE ON my_table FOR EACH ROW
SET NEW.language = LOWER(NEW.language);
次に、既存のデータを更新します:
UPDATE my_table SET language = LOWER(language);