字符串函數
更新時間 2025-06-17 10:58:14
最近更新時間: 2025-06-17 10:58:14
分享文章
本文介紹DRDS支持的字符串函數。
| 函數表達式 | 函數描述 |
|---|---|
| ASCII() | Return numeric value of left-most character |
| BIN() | Return a string containing binary representation of a number |
| BIT_LENGTH() | Return length of argument in bits |
| CHAR_LENGTH() | Return number of characters in argument |
| CHAR() | Return the character for each integer passed |
| CHARACTER_LENGTH() | Synonym for CHAR_LENGTH() |
| CONCAT_WS() | Return concatenate with separator |
| CONCAT() | Return concatenated string |
| ELT() | Return string at index number |
| 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 |
| FIELD() | Return the index (position) of the ?rst argument in the subsequent arguments |
| FIND_IN_SET() | Return the index position of the ?rst argument within the second argument |
| FORMAT() | Return a number formatted to speci?ed number of decimal places |
| HEX() | Return a hexadecimal representation of a decimal or string value |
| INSERT() | Insert a substring at the speci?ed position up to the speci?ed number of characters |
| INSTR() | Return the index of the ?rst occurrence of substring |
| LCASE() | Synonym for LOWER() |
| LEFT() | Return the leftmost number of characters as specifified |
| QUOTE() | Escape the argument for use in an SQL statement |
| NOT REGEXP | Negation of REGEXP |
| NOT LIKE | Negation of simple pattern matching |
| LTRIM() | Remove leading spaces |
| REPEAT() | Repeat a string the specifified number of times |
| REPLACE() | Replace occurrences of a specifified string |
| MAKE_SET() | Return a set of comma-separated strings that have the corresponding bit in bits set |
| OCT() | Return a string containing octal representation of a number |
| MID() | Return a substring starting from the specifified position |
| ORD() | Return character code for leftmost character of the argument |
| LOWER() | Return the argument in lowercase |
| LENGTH() | Return the length of a string in bytes |
| LOCATE() | Return the position of the fifirst occurrence of substring |
| LPAD() | Return the string argument, left-padded with the specifified string |
| REVERSE() | Reverse the characters in a string |
| LIKE | Simple pattern matching |
| OCTET_LENGTH() | Synonym for LENGTH() |
| POSITION() | Synonym for LOCATE() |
| RIGHT() | Return the specifified rightmost number of characters |
| RPAD() | Append string the specifified number of times |
| STRCMP() | Compare two strings |
| UPPER() | Convert to uppercase |
| TRIM() | Remove leading and trailing spaces |
| RTRIM() | Remove trailing spaces |
| UNHEX() | Return a string containing hex representation of a number |
| SPACE() | Return a string of the specifified number of spaces |
| SUBSTRING_INDEX() | Return a substring from a string before the specifified number of occurrences of the delimiter |
| SUBSTR() | Return the substring as specifified |
| SUBSTRING() | Return the substring as specifified |
| UCASE() | Synonym for UPPER() |