目录

SQL服务器 RTRIM() 函数

示例

从字符串中删除尾随空格:

SELECT RTRIM('SQL Tutorial     ') AS RightTrimmedString;
亲自试一试 »

定义和用法

RTRIM() 函数删除字符串中的尾随空格。

笔记:另请参阅LTRIM()功能。

语法

RTRIM( string)

参数值

Parameter Description
string Required. The string to remove trailing spaces from

技术细节

工作于: SQL Server(从 2008 年开始)、Azure SQL 数据库、Azure SQL 数据仓库、并行数据仓库