MySQL trim function

MySQL Cluster

MySQL TRIM() function returns a string after removing all prefixes or suffixes from the given string. Syntax TRIM([{BOTH | LEADING | TRAILING} [remstr] FROM ] str) Arguments Name Description BOTH Indicates that prefixes from both left and right are to be removed. LEADING Indicates that only leading prefixes are to be removed. TRAILING Indicates that … Read more

MySQL RAND Function

MySQL Cluster

MySQL has a RAND function that can be invoked to produce random numbers between 0 and 1: mysql> SELECT RAND( ), RAND( ), RAND( ); +——————+—————–+——————+ | 0.45464584925645 | 0.1824410643265 | 0.54826780459682 | +——————+—————–+——————+ 1 row in set (0.00 sec) When invoked with an integer argument, RAND( ) uses that value to seed the random … Read more

mysql locate function

MySQL Cluster

MySQL LOCATE() returns the position of the first occurrence of a string within a string. Both of these strings are passed as arguments. An optional argument may be used to specify from which position of the string (i.e. string to be searched) searching will start. If this position is not mentioned, searching starts from the … Read more

mysql concat function

MySQL Cluster

MySQL CONCAT function is used to concatenate two strings to form a single string. Description: MySQL CONCAT() function is used to add two or more strings. There may be one or more arguments. Returns the string that results from concatenating the arguments. Returns a non binary string, if all arguments are non binary strings. Returns … Read more

MySQL substring function

MySQL Cluster

MySQL SUBSTRING() returns a specified number of characters from a particular position of a given string. Syntax: SUBSTRING(str, pos, len) or SUBSTRING(str FROM pos FOR len) Arguments Name       Description str              A string. pos             Starting position. len         … Read more