
The length of the characters can exceed the maximum length of the original string.The SUBSTRING function will throw an error if the length parameter is negative.Refer the image below for the pictorial representation of SUBSTRING in SQL. Length – Represents the number of characters which you wish to extract.The first character in the string is given the value 1. Starting_value – This represents the starting position of the string.String – Represents the string from which you have to extract a set of characters.SUBSTRING(string, starting_value, length) With the help of this function, you can retrieve any number of substrings from a single string. SUBSTRING in SQL is a function used to retrieve characters from a string. Next, in this article let us delve deeper into what is SUBSTRING in SQL and how to use it. SUBSTRING is one such command in SQL, used to retrieve a set of characters from the specified string. It consists of various commands segregated into 4 categories (DDL, DML, DCL, and TCL). SQL or Structured Query Language is developed by Donald D.Chamberlin and is used to manage, access and retrieve data in a database. The following topics will be covered in this article: In this article on a substring in SQL, I will show you how to extract a set of characters from a string. Structured Query Language aims to give users the ability to retrieve the data in a format they want.
