MS Access Left()ฟังก์ชั่น
ตัวอย่าง
แยกอักขระ 3 ตัวออกจากสตริง (เริ่มจากซ้าย):
SELECT Left("SQL Tutorial", 3) AS ExtractString;
ความหมายและการใช้งาน
ฟังก์ชัน Left() จะแยกอักขระจำนวนหนึ่งออกจากสตริง (เริ่มจากด้านซ้าย)
หมายเหตุ:ดูฟังก์ชันRight() ด้วย
ไวยากรณ์
Left(string, number_of_chars)
ค่าพารามิเตอร์
Parameter | Description |
---|---|
string | Required. The string to extract from |
number_of_chars | Required. The number of characters to extract. If this parameter is higher than the number of characters in string, this function will return the entire string |
รายละเอียดทางเทคนิค
ทำงานใน: | จากการเข้าถึง 2000 |
---|
ตัวอย่างเพิ่มเติม
ตัวอย่าง
แยกอักขระ 5 ตัวจากข้อความในคอลัมน์ "CustomerName" (เริ่มจากซ้าย):
SELECT Left(CustomerName, 5) AS ExtractString
FROM Customers;