Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.
返回字符串中最右边的字符。
RIGHT( string-expression, integer-expression )
string-expression 要返回最右侧字符的字符串。
integer-expression 要返回的从字符串结尾处开始计数的字符数。
如果字符串包含多字节字符,并且使用了适当的归类,则返回的字节数可能大于指定的字符数。
指定的 integer-expression 可以比列中的值大。这种情况下将返回整个值。
此函数支持 NCHAR 输入和/或输出。如果输入字符串使用字符长度语义,就会在可能的情况下根据字符长度语义对返回值进行说明。
SQL/2008 服务商扩充。
以下语句返回 Customers 表中每个 Surname 值的最后 5 个字符。
SELECT RIGHT( Surname, 5) FROM Customers;