可以说我有这样的事情
uid tag
1 HeLLo
2 heLLO
3 HELLO
4 hello
如何将“标签”列中的所有值更新为:
uid tag
1 hello
2 hello
3 hello
4 hello
使用MySQL?
可以说我有这样的事情
uid tag
1 HeLLo
2 heLLO
3 HELLO
4 hello
如何将“标签”列中的所有值更新为:
uid tag
1 hello
2 hello
3 hello
4 hello
使用MySQL?
Answers:
参见http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_lower
UPDATE table_name SET tag = LOWER(tag)
UPDATE table_name SET tag = BINARY LOWER(tag)
不区分大小写的匹配。
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
试试这个:
update `table` set `column_name` = LOWER(column_name without quotation)