Reputation: 11
I have table called user. And it contains names like
user
xyz.abc
123.abc
atr.abc
etc.....
I need a query such that output should not contain the names after dot(.)
Upvotes: 0
Views: 84
Reputation: 28685
You can use SUBSTRING_INDEX
SELECT SUBSTRING_INDEX(name, '.', 1) from USER;
Upvotes: 4