Substring in SQL will Extract the characters from an starting point of the strings in the column name of the database.The syntax for it is
SUBSTRING(string or column name, startIndex, length)
string denotes the columnname or the string value
start index denotes the starting point from where extraction begins
length denotes the how many characters to be extracted.
Example Select query using substring:
SUBSTRING(string or column name, startIndex, length)
string denotes the columnname or the string value
start index denotes the starting point from where extraction begins
length denotes the how many characters to be extracted.
Example Select query using substring:
SELECT SUBSTRING(Names,2,3) as 'substring' FROM TABLENAMEThis query will return Names starting from 3 and return 3 characters from the strings in that columname.
No comments:
Post a Comment