MySQL String Functions Part1
String Functions
A string function is a function that takes a string value as an input and the return value (output) can be a string / numeric / character value.
In SQL Server, there are many built-in string functions that can be used by developers say almost 50.
Sytnax - string_function_name(argument1,[arg2, arg3...]);
mysql> SELECT UPPER(‘MAJOR PRATAP’); ??
mysql> SELECT UPPER(‘20000.00’); ?? 20000.00
mysql>SELECT UPPER(SalePrice)FROM SALES; ??
2. LOWER(string) OR LCASE(string) - will convert the upper-case alphabets into lower case of the string specified in the argument value.
3. SUBSTRING(string, pos, n) – Will return a new string from the main string ‘string’ from the specified position ‘pos’ and of the length ‘n’. String – can be any string value.
Pos – will be a numeric value which will specify the starting position of the returned new string unlike python the starting index address is always 1 never 0 of the first character. n – will be a numeric value which will specify the total number of characters to be returned as a new string.
Comments
Post a Comment