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 Next is the substring function 1
Substring function is used to extract a substring of a string 2
So for example, if you have a long string and you want to take out a part of that string 3
That is where substring will help you 4
The syntax for substring is you write substring and within the parentheses 5
You write the string first 6
Then you mention 7
From the starting position so you will give the starting position after writing the keyword from 8
After that you can mention the length of characters 9
That you want after the starting position 10
So for this much length 11
Let us look at an example to understand the substring function 12
If you remember in the customer table customer id has two parts 13
The first part is the two characters these two characters are the first characters of the customers name first name 14
Last name 15
After those two characters that is a hyphen 16
And after that hyphen there are five numbers which may be randomly generated 17
If you want to 18
Segregate these two parts 19
So, if you want to get the initials of the customer 20
Separately into one column and if you want to get the unique identifying number 21
Into another column 22
You can do that using the substring 23
with the first select statement I am writing customer ID customer name 24
and I am getting the substring, the first two characters of the customer ID 25
You can see the syntax here substring 26
I will mention the column name 27
For 2 I have not mentioned from 28
Because 29
From 30
By default it will be the first character if I want to get it to some other position I have to mention the 31
From keyword 32
This column I have named as customer group 33
From customer table where substring 34
Customer ID for 2 is equal to AB so what this will give me is 35
Only those 36
Records with customer ID is starting with characters AB 37
The 2nd select statement 38
I am taking out the five randomly generated 39
Digits 40
To do that 41
I have to start from the 4th position 42
In the first two position is the these two characters 43
The third position is taken by 44
The hyphen 45
So the number starts from 4th position 46
and the number has 47
Length of 5 characters 48
So there are five different 49
Numbers 50
I'll take out this 51
5 52
Characters as a substring 53
Let us go and write these two queries to get the two 54
Parts of the customer ID 55
So select customer ID customer name 56
and Substring 57
Mention the string 58
Which will be the column name 59
For two characters 60
Name this column as customer group 61
This all is coming from table 62
Customer 63
Where 64
The first two characters 65
are AB. so I will copy this substring down and this should be same as AB 66
Let us select this query and run it 67
You can see I have only those 68
Customers where customer ID is starting with AB 69
and the customer group column has that 70
Substring 71
The first two characters of the customer ID 72
so it is AB for all these customers 73
Now let us take out the last 74
Five digits 75
These are the five digits of the customer ID 76
We want to take these out into a separate column. Let us go and write the query for that 77
Select 78
Customer ID customer name 79
and substring 80
Customer ID 81
From 4 82
it starts from the fourth character for 5 characters 83
as 84
Customer number 85
From customer table 86
Where substring 87
Customer ID for 2 is AB 88
So for this customer group only we find out the 89
Last five digits 90
So it should contain 10165 for the First row 91
Let's select and run this query 92
So can see 93
10165 is the value mentioned here 94
So this customer num column has the last five digits 95
of the customer ID 96
This is how we use substring to take out a 97
Second string 98
From a primary string
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.