Is it possible to count the amount of letters in the alphabet that exists in mysql column?
I would like to get a count of first letters in a column.
Example:
My column has names like alice, jacob, james, britney and so on. I would like to count the amount of letters in the alphabet that exists. In the above it wo开发者_开发技巧uld be 3 even though the letter "j" is repeated.Thanks for any help.
Try
SELECT COUNT(DISTINCT SUBSTRING(`name`, 1, 1)) FROM `users`
精彩评论