MID()

Scalar. Returns a range of characters from a given string.

Syntax

MID( string, start, end )
Parameters

string

The string.

start

The position of the first character to return (one-based).

end

The position of the last character to return.

Data Types

Return

string

start

end

String

String

Integer

Integer

Example

The following example uses the MID function to select the fifth through seventh characters of the column named LastName:

INSERT INTO OutStream
SELECT MID(Employees.LastName, 5, 7)
FROM Employees;

If the employee's last name were "Johnson", this would return "son".