OCTET_LENGTH() FUNCTION in MySQL

OCTET_LENGTH() FUNCTION The MySQL OCTET_LENGTH function is used to get the length of the specified string. Syntax: OCTET_LENGTH (string); Parameters: string: It is used to specify the string to evaluate. Example: mysql> SELECT OCTET_LENGTH (‘ABC’); Output: 3 Explanation: The length of the specified string is returned.

MAKE_SET() FUNCTION in MySQL

MAKE_SET() FUNCTION The MySQL MAKE_SET function is used to get values from the set for the given bit. Syntax: MAKE_SET (bits, string_1, string_2, … string_n ); Parameters: bits: It is used to specify the bits to return. string_1, string_2, … string_n: It is used to specify a list of strings. Example: mysql> SELECT MAKE_SET (1, … Read more

LOAD_FILE() FUNCTION in MySQL

LOAD_FILE() FUNCTION The MySQL LOAD_FILE function is used to get the content of the specified file. Syntax: LOAD_FILE (file_name); Parameters: file_name: It is used to specify the name of the file to read. Example: mysql> Update stud_table set img = LOAD_FILE(‘E:\file.jpg’); Output: Query OK, 3 rows affected (1.01 sec)

LIKE() FUNCTION in MySQL

LIKE() FUNCTION The MySQL LIKE function is used to check for pattern matching. Syntax: string LIKE pattern; Parameters: string: It is used to specify the string to evaluate. pattern: It is used to specify the pattern to match. Example 1: mysql> SELECT ‘abc’ LIKE ‘ABC’; Output: 1 Explanation: The LIKE function returns 1 for a … Read more

ELT() FUNCTION in MySQL

ELT() FUNCTION The MySQL ELT function is used to extract the nth string from the list of strings. Syntax: ELT( n, string_1, string_2, … string_n ); Parameters: n: It is used to specify the index of the string to extract. string_1, string_2, … string_n: It is used to specify a list of strings. Example: mysql> … Read more

HEX() FUNCTION in MySQL

HEX() FUNCTION The MySQL HEX function is used to get a hexadecimal string for the specified string. Syntax: HEX( string ) Parameters: string: It is used to specify the string to evaluate. Example 1: mysql> SELECT HEX ( ‘A’ ); Output: 41 Explanation: The hex code of the string is returned. Example 2: mysql> SELECT … Read more