Afrikaans
Akan
Albanian
Amharic
Arabic
Armenian
Azerbaijani
Basque
Belarusian
Bemba
Bengali
Bihari
Bosnian
Breton
Bulgarian
Cambodian
Catalan
Cebuano
Cherokee
Chichewa
Chinese (Simplified)
Chinese (Traditional)
Corsican
Croatian
Czech
Danish
Dutch
English
Esperanto
Estonian
Ewe
Faroese
Filipino
Finnish
Frisian
Ga
Galician
Georgian
German
Greek
Guarani
Gujarati
Haitian Creole
Hausa
Hawaiian
Hebrew
Hindi
Hmong
Hungarian
Icelandic
Igbo
Indonesian
Interlingua
Irish
Italian
Japanese
Javanese
Kannada
Kazakh
Kinyarwanda
Kirundi
Kongo
Korean
Krio (Sierra Leone)
Kurdish
Kurdish (Soranรฎ)
Kyrgyz
Laothian
Latin
Latvian
Lingala
Lithuanian
Lozi
Luganda
Luo
Luxembourgish
Macedonian
Malagasy
Malay
Malayalam
Maltese
Maori
Marathi
Mauritian Creole
Moldavian
Mongolian
Myanmar (Burmese)
Montenegrin
Nepali
Nigerian Pidgin
Northern Sotho
Norwegian
Norwegian (Nynorsk)
Occitan
Oriya
Oromo
Pashto
Persian
Polish
Portuguese (Brazil)
Portuguese (Portugal)
Punjabi
Quechua
Romanian
Romansh
Runyakitara
Russian
Samoan
Scots Gaelic
Serbian
Serbo-Croatian
Sesotho
Setswana
Seychellois Creole
Shona
Sindhi
Sinhalese
Slovak
Slovenian
Somali
Spanish
Spanish (Latin American)
Sundanese
Swahili
Swedish
Tajik
Tamil
Tatar
Telugu
Thai
Tigrinya
Tonga
Tshiluba
Tumbuka
Turkish
Turkmen
Twi
Uighur
Ukrainian
Urdu
Uzbek
Vietnamese
Welsh
Wolof
Xhosa
Yiddish
Yoruba
Zulu
0 Hi everyone 1
In this section 2
Will be discussing about the various types of string functions that we have 3
So, when we are retrieving data or when we are storing data into tables 4
Several times the data is of string type 5
And you can process the data 6
To make it more meaningful to 7
Add value to that data 8
either while retrieving or while saving it to the table using the string functions 9
There are several types of string functions available 10
Let us look at the first one 11
The first is the length 12
Function 13
Length function is used to return the length of specified string 14
So that you get the number of characters in that string 15
This function can be put to use for example if you are a marketing head or you are planning to send out SMS 16
or Emails to the customers 17
And the agency that you are using is charging you on per character basis so you want to find out the 18
Number of characters that will be part of your SMS or your email 19
This is where this particular function will help you 20
The syntax for length function is very simple you just write length and you give the string in the parenthesis 21
And it will return you 22
The number of characters in that string 23
Let us look at an example 24
We have the customer table 25
We want to find out the length of name of each customer 26
To do that we will write this simple query. select customer name against that we want the length of the 27
Customer name 28
In characters 29
From the customer table 30
And this condition I'll just put to show you that you can use conditions also you can write the where 31
Statement also 32
So let us go and write this in the PG admin 33
We start typing select customer name against name 34
we will be finding out the length. so length 35
Customer name 36
As 37
as characters 38
Number 39
From 40
Customer table 41
And you can put the condition if you want to. so write where 42
age is greater than 30 43
When you run this you see that 44
so for example this fourth name is Andrew Allen 45
So Andrew is 6 characters there is a space in between which is one character and there is a Allen which is 5 46
Characters so total its a string of 12 characters 47
We use the length function in the select part of this query 48
You can use length in the where part of this query also so you can just put a condition on length 49
Length of characters is greater than probably 10 50
or 15 51
When you run this, Andrew will not be part of 52
this data 53
So 54
Length function can be used in the select part also and the where part also
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.