LEFT() extracts a specified number of characters from the beginning of a string. This function is useful for string manipulation, data extraction, and formatting where you need to work with the left portion of a string.
LEFT(string, length)
LEFT() returns a character string
LEFT("APPLES AND ORANGES", 5) = "APPLE" (first 5 characters)
LEFT("APPLES AND ORANGES", 10) = "APPLES AND" (first 10 characters)
LEFT("APPLES AND ORANGES", 20) = "APPLES AND ORANGES" (entire string)
LEFT("Hello World", 3) = "Hel" (first 3 characters)
LEFT("12345", 2) = "12" (first 2 characters)
LEFT("", 5) = "" (empty string)
LEFT(NULL, 5) = NULL (NULL input)