MS Access Left() 函数
定义和用法
Left() 函数从字符串中提取一定数量的字符(从左开始)。
另请参阅
SQL Server 参考手册:Right() 函数
实例
例子 1
从字符串中提取 3 个字符(从左开始):
SELECT Left("SQL Tutorial", 3) AS ExtractString;
例子 2
从 "CustomerName" 列中的文本中提取 5 个字符(从左开始):
SELECT Left(CustomerName, 5) AS ExtractString FROM Customers;
语法
Left(string, number_of_chars)
参数
| 参数 | 描述 |
|---|---|
| string | 必需。要从中提取的字符串。 |
| number_of_chars |
必需。要提取的字符数。 如果此参数高于字符串中的字符数,则此函数将返回整个字符串。 |
技术细节
| 适用于: | 从 Access 2000 开始 |
|---|