Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个叫做用户的表。它包含像这样的名字
user xyz.abc 123.abc atr.abc etc.....
我需要一个查询,以便输出不应包含点(。)之后的名称
您可以使用SUBSTRING_INDEX
SELECT SUBSTRING_INDEX(name, '.', 1) from USER;
select rtrim(username,'.') from user