String Function in SQL

What is String Function in SQL ?

SQL String function will be applied for each row and produces individual output for each row.

Other wise String function called as character function.

There are

Sr.No.Function & Description
1UPPER
convert the string into upper case.
2LOWER
convert the string into lower case.
3INITCAP
convert 1st character in each word into uppercase and other are lower in a string.
4TRIM
remove all specified characters from both sides of string.
5RTRIM
remove all specified characters from right end sides of string.
6LTRIM
remove all specified characters from left end sides of string.
7RPAD
allows you to pad the right side of column with any set of character.
8LPAD
allows you to pad the left side of column with any set of character.
9TRANSLATE
translate single character at a time
10REPLACE
replace multiple character at a time
11SUBSTR
to show specific character of a string
12INSTR
to show the position of character of a string
13CONCAT
used to combine two string.
14ASCII
return the decimal representation in database character set of the first character of string
15CHR
return the high level language character from ASCII value
16SOUNDEX
return the values whose pronunciation as some but spell differently
17DECORD
act as value by value substitution
18GREATEST
give the greatest string
19LEAST
give least string
20COALESCE
give the first non_null string
21LENGTH
give length of string
22CONCATENATION
23||

1.UPPER

This will convert the string into uppercase.
Syntax: upper (string)
Ex:
SQL> select upper(‘computer’) from dual;

output COMPUTER

upper function in SQL
upper function in SQL

Leave a Reply