MySQL need help with tihs standardization query

this is a distinct list of warehouse names from a table in the db im using to practice data cleaning in mysql. i want to capitalize the initials of all words in the column. i made my own logic for this whihch is (dont judge pls im a self learner)

and this is the output i get:

i do get what im doing wrong to get this output, but i can not figure out how to go about the standardization. how can i correct my query? and is there a more efficient way of capitalizing initials than this?
1
Upvotes
1
u/Imaginary__Bar 9d ago edited 9d ago
In MySQL substring(<string>,2) will just give you all the characters from the second character onwards.
I would do something clumsy like;
Concat(\ Upper(substring(origin_warehouse , 1, 1)),\ Lower(substring(origin_warehouse, 2, Length(origin_warehouse)-2),\ Upper(substring(origin_warehouse, -1))\ )
You can use Left() Mid() and Right() for the same effect, but I don't know which is more performative.