The
Syntax: SUBSTR(string,position,length)
Another syntax: SUBSTR(string,FROM position,FOR length)
Arguments:
string: A string
position: Starting position
length: Length in characters and it is optional.
SUBSTRING('MySQL SUBSTRING',5,6) // L SUBS
SUBSTRING('MySQL SUBSTRING',5) // L SUBSTRING (FROM postion 5 to end)
SUBSTRING('MySQL SUBSTRING',-5) // TRING
SUBSTRING('MySQL SUBSTRING',-10,6) // L SUBS
SUBSTRING('MySQL SUBSTRING',FROM 5 FOR 6) // L SUBS
The
SUBSTRING
function returns a substring from a string
starting at a specific position with a given length. MySQL provides
various forms of the substring function.Syntax: SUBSTR(string,position,length)
Another syntax: SUBSTR(string,FROM position,FOR length)
Arguments:
string: A string
position: Starting position
length: Length in characters and it is optional.
-15 -14 -13 -12 -11 -10 -9 -8 -7 -6 -5 -4 -3 -2 -1 |
SUBSTRING('MySQL SUBSTRING',5,6) // L SUBS
SUBSTRING('MySQL SUBSTRING',5) // L SUBSTRING (FROM postion 5 to end)
SUBSTRING('MySQL SUBSTRING',-5) // TRING
SUBSTRING('MySQL SUBSTRING',-10,6) // L SUBS
SUBSTRING('MySQL SUBSTRING',FROM 5 FOR 6) // L SUBS
The
SUBSTR()
is synonym for the SUBSTRING()
so you can use both of them interchangeably.
SUBSTRING(str, pos, len)
ING()
returns a specified number of characters from a particular position
of a given string. - See more at:
http://www.w3resource.com/mysql/string-functions/mysql-substring-function.php#sthash.IH603WfX.dpuf
MySQL SUBSTRING() returns a specified number of characters from a particular position of a given string.
Syntax
SUBSTRING(str, pos, len)
- See more at: http://www.w3resource.com/mysql/string-functions/mysql-substring-function.php#sthash.IH603WfX.dpuf
MySQL SUBSTRING() returns a specified number of characters from a particular position of a given string.
Syntax
SUBSTRING(str, pos, len)
- See more at: http://www.w3resource.com/mysql/string-functions/mysql-substring-function.php#sthash.IH603WfX.dpuf
MySQL SUBSTRING() returns a specified number of characters from a particular position of a given string.
Syntax
SUBSTRING(str, pos, len)
- See more at: http://www.w3resource.com/mysql/string-functions/mysql-substring-function.php#sthash.IH603WfX.dpuf
MySQL SUBSTRING() returns a specified number of characters from a particular position of a given string.
Syntax
SUBSTRING(str, pos, len)
- See more at: http://www.w3resource.com/mysql/string-functions/mysql-substring-function.php#sthash.IH603WfX.dpuf
0 comments:
Post a Comment