izbryte Posted March 15, 2011 Share Posted March 15, 2011 Hello, I have a table with over 20,000 rows that's been input in all uppercase. I'm wondering if there's an easy way to transform the text from uppercase to capitalized? Thanks in advance! Quote Link to comment https://forums.phpfreaks.com/topic/230752-changing-the-case-upper-to-capitalized-of-20000-rows-of-data-at-once/ Share on other sites More sharing options...
Maq Posted March 15, 2011 Share Posted March 15, 2011 uppercase to capitalized Correct me if I'm mistaken, but isn't that the same thing? If not, could you clarify what you mean. Quote Link to comment https://forums.phpfreaks.com/topic/230752-changing-the-case-upper-to-capitalized-of-20000-rows-of-data-at-once/#findComment-1187955 Share on other sites More sharing options...
JamieB Posted March 15, 2011 Share Posted March 15, 2011 UPPER CASE Capitalized I think? Quote Link to comment https://forums.phpfreaks.com/topic/230752-changing-the-case-upper-to-capitalized-of-20000-rows-of-data-at-once/#findComment-1187966 Share on other sites More sharing options...
Maq Posted March 15, 2011 Share Posted March 15, 2011 UPPER CASE Capitalized I think? That's what I thought. I took this out of the MySQL manual, so test it first but you can use a combination of UPPER and SUBSTRING functions to accomplish this: SELECT CONCAT(UPPER(SUBSTRING(firstName, 1, 1)), LOWER(SUBSTRING(firstName FROM 2))) AS properFirstName You would have to update the table and use REPLACE to actually change the values. Quote Link to comment https://forums.phpfreaks.com/topic/230752-changing-the-case-upper-to-capitalized-of-20000-rows-of-data-at-once/#findComment-1187967 Share on other sites More sharing options...
izbryte Posted March 15, 2011 Author Share Posted March 15, 2011 Yep! That's what I meant! Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/230752-changing-the-case-upper-to-capitalized-of-20000-rows-of-data-at-once/#findComment-1187975 Share on other sites More sharing options...
fenway Posted March 17, 2011 Share Posted March 17, 2011 That's not going to work in the general case. Quote Link to comment https://forums.phpfreaks.com/topic/230752-changing-the-case-upper-to-capitalized-of-20000-rows-of-data-at-once/#findComment-1188736 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.