내가 이런 걸 가지고 있다고하자
uid tag
1 HeLLo
2 heLLO
3 HELLO
4 hello
“태그”열의 모든 값을 다음으로 업데이트하려면 어떻게해야합니까?
uid tag
1 hello
2 hello
3 hello
4 hello
MySQL을 사용하십니까?
답변
참조 http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_lower를
UPDATE table_name SET tag = LOWER(tag)
답변
update table set tag = LOWER(tag)
답변
전체 열을 업데이트하지 않으려는 경우 대소 문자를 구분하지 않고 “WHERE”절을 포함하는 버전 :
UPDATE table
SET tag = LOWER(tag)
WHERE LOWER(tag) != tag
COLLATE Latin1_General_CS_AS
COLLATE 라인은 데이터베이스가 대소 문자를 구분하지 않는 일치를 사용하는 경우 작동합니다.
답변
이 시도:
update `table` set `column_name` = LOWER(column_name without quotation)