Jump to: navigation, search

MySQL String Functions

From w3cyberlearnings
# Function Description
1 ASCII Return numeric value of left-most character
2 BIN Return a string representation of the argument
3 BIT_LENGTH Return length of argument in bits
4 CHAR_LENGTH Return number of characters in argument
5 CHAR Return the character for each integer passed
6 CHARACTER_LENGTH A synonym for CHAR_LENGTH
7 CONCAT_WS Return concatenate with separator
8 CONCAT Return concatenated string
9 ELT Return string at index number
10 EXPORT_SET Return a string such that for every bit set in the value bits, you get an on string and for every unset bit, you get an off string
11 FIELD Return the index (position) of the first argument in the subsequent arguments
12 FIND_IN_SET Return the index position of the first argument within the second argument
13 FORMAT Return a number formatted to specified number of decimal places
14 HEX Return a hexadecimal representation of a decimal or string value
15 INSERT Insert a substring at the specified position up to the specified number of characters
16 INSTR Return the index of the first occurrence of substring
17 LCASE Synonym for LOWER
18 LEFT Return the leftmost number of characters as specified
19 LENGTH Return the length of a string in bytes
20 LIKE Simple pattern matching
21 LOAD_FILE Load the named file
22 LOCATE Return the position of the first occurrence of substring
23 LOWER Return the argument in lowercase
24 LPAD Return the string argument, left-padded with the specified string
25 LTRIM Remove leading spaces
26 MAKE_SET Return a set of comma-separated strings that have the corresponding bit in bits set
27 MATCH Perform full-text search
28 MID Return a substring starting from the specified position
29 NOT LIKE Negation of simple pattern matching
30 NOT REGEXP Negation of REGEXP
31 OCTET_LENGTH A synonym for LENGTH
32 ORD Return character code for leftmost character of the argument
33 POSITION A synonym for LOCATE
34 QUOTE Escape the argument for use in an SQL statement
35 REGEXP Pattern matching using regular expressions
36 REPEAT Repeat a string the specified number of times
37 REPLACE Replace occurrences of a specified string
38 REVERSE Reverse the characters in a string
39 RIGHT Return the specified rightmost number of characters
40 RLIKE Synonym for REGEXP
41 RPAD Append string the specified number of times
42 RTRIM Remove trailing spaces
43 SOUNDEX Return a soundex string
44 SOUNDS LIKE Compare sounds
45 SPACE Return a string of the specified number of spaces
46 STRCMP Compare two strings
47 SUBSTR Return the substring as specified
48 SUBSTRING_INDEX Return a substring from a string before the specified number of occurrences of the delimiter
49 SUBSTRING Return the substring as specified
50 TRIM Remove leading and trailing spaces
51 UCASE Synonym for UPPER
52 UNHEX Convert each pair of hexadecimal digits to a character
53 UPPER Convert to uppercase


Related Links

Navigation
Web
SQL
MISC
References