如何对mysql列进行“适当大小写"格式? [英] How to do a 'Proper case' formatting of a mysql column?
本文介绍了如何对mysql列进行“适当大小写"格式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在mysql中是否可以格式化适当大小写的列?
Is it possible in mysql to format a column in Proper Case?
示例:Proper("ABSALOM") = "Absalom"
我进行了很多搜索,我认为MySQL没有任何内置函数可以执行此操作.可以在MySQL中以其他任何方式执行此操作吗?
I have searched a lot and I think MySQL doesn't have any inbuilt function to do this. Is it possible to do this any other way in MySQL?
推荐答案
您可以结合使用CONCAT和SUBSTRING:
You can combine CONCAT and SUBSTRING:
CONCAT(UCASE(SUBSTRING(`fieldName`, 1, 1)), LOWER(SUBSTRING(`fieldName`, 2)))
这篇关于如何对mysql列进行“适当大小写"格式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文