In my MySQL I have a table user
. There's an email
field.
Some emails have many dots in them, e.g.: firstname.lastname.smth.else@example.com
I'd like to select everything after last dot. In case of the email above it'll be com
.
So far I've came up only with:
SELECT RIGHT(email, LOCATE('.', email) - 1) FROM user;
but it seems to trim only after the first dot.