SQL basics- complete reference guide - part6 - String functions

Part6: SQL String Functions Complete Reference

TOPICTEXTSYNTAXExample
ASCIIReturns the ASCII value of the first character in the string.ASCII(string)
BIT_LENGTHReturns the number of bits in a string.BIT_LENGTH(string)
LENGTHReturns the number of characters in a string.{ LENGTH | CHAR_LENGTH | CHARACTER_LENGTH } ( string )
OCTET_LENGTHReturns the number of bytes in a string.OCTET_LENGTH(string)
CHARReturns the character that represents the ASCII value.{ CHAR | CHR } ( int )
CONCATCombines strings.CONCAT(string, string [,...])
DIFFERENCEReturns the difference between the sounds of two strings.DIFFERENCE(string, string)
HEXTORAWConverts a hex representation of a string to a string.HEXTORAW(string)
RAWTOHEXConverts a string to the hex representation.RAWTOHEX(string)
INSTRReturns the location of a search string in a string.INSTR(string, searchString, [, startInt])
INSERT FunctionInserts a additional string into the original string at a specified start position.INSERT(originalString, startInt, lengthInt, addString)
LOWERConverts a string to lowercase.{ LOWER | LCASE } ( string )
UPPERConverts a string to uppercase.{ UPPER | UCASE } ( string )
LEFTReturns the leftmost number of characters.LEFT(string, int)
RIGHTReturns the rightmost number of characters.RIGHT(string, int)
LOCATEReturns the location of a search string in a string.LOCATE(searchString, string [, startInt])
POSITIONReturns the location of a search string in a string.POSITION(searchString, string)
LPADLeft pad the string to the specified length.LPAD(string, int[, paddingString])
RPADRight pad the string to the specified length.RPAD(string, int[, paddingString])
LTRIMRemoves all leading spaces from a string.LTRIM(string)
RTRIMRemoves all trailing spaces from a string.RTRIM(string)
TRIMRemoves all leading spaces, trailing spaces, or spaces at both ends, from a string.TRIM ( [ { LEADING | TRAILING | BOTH } [ string ] FROM ] string )
REGEXP_REPLACEReplaces each substring that matches a regular expression.REGEXP_REPLACE(inputString, regexString, replacementString)
REPEATReturns a string repeated some number of times.REPEAT(string, int)
REPLACEReplaces all occurrences of a search string in a text with another string.REPLACE(string, searchString [, replacementString])
SOUNDEXReturns a four character code representing the sound of a string.SOUNDEX(string)
SPACEReturns a string consisting of a number of spaces.SPACE(int)
STRINGDECODEConverts a encoded string using the Java string literal encoding format.STRINGDECODE(string)
STRINGENCODEEncodes special characters in a string using the Java string literal encoding format.STRINGENCODE(string)
STRINGTOUTF8Encodes a string to a byte array using the UTF8 encoding format.STRINGTOUTF8(string)
SUBSTRINGReturns a substring of a string starting at a position.{ SUBSTRING | SUBSTR } ( string, startInt [, lengthInt ] )
UTF8TOSTRINGDecodes a byte array in the UTF8 format to a string.UTF8TOSTRING(bytes)
XMLATTRCreates an XML attribute element of the form "name=value".XMLATTR(nameString, valueString)
XMLNODECreate an XML node element.XMLNODE(elementString [, attributesString [, contentString]])
XMLCOMMENTCreates an XML comment.XMLCOMMENT(commentString)
XMLCDATACreates an XML CDATA element.XMLCDATA(valueString)
XMLSTARTDOCThe string "XMLSTARTDOC()
XMLTEXTCreates an XML text element.XMLTEXT(valueString)

No comments :

Post a Comment

Your Comment and Question will help to make this blog better...