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