The SUBSTRING function in SQL queries is most often used when working with text data - it is responsible for "trimming" the string passed to it.
Syntax
As with most programming languages, including ORACLE and MS SQL, SUBSTRING includes three parameters. The first argument of the function is the input string itself - it can be either explicitly registered or obtained as a result of executing some request. Two numerical parameters follow - the starting character, from which the crop will occur, and directly the length - the number of characters that you want to read, starting from the starting position.
The SQL query structure is as follows:
SUBSTRING ("some string", 1, 3)
"" - SQL SUBSTRING , , , , "". , , , , .
SQL SUBSTRING - . , . , , , , SUBSTRING .
SELECT Addres, SUBSTRING(LastName, 1, 1) AS FirstChar FROM Clients
, , , , FirstChar.
- .
SELECT LastName & ' ' & SUBSTRING(FirstName, 1, 1) & '.' AS Initial FROM Clients
, SQL SUBSTRING , .