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 In the last video, we learned how to use the in statement 1
Now let us learn how to use the between condition 2
Between condition is used to retrieve values within a particular range 3
So while using between we'll need to specify a lower value 4
And 5
Upper value 6
Between which the condition will be giving us the values back. The Syntax to use the between command is 7
Select 8
Column names 9
From table names 10
Where 11
A Particular column 12
Value is between a lower value and a higher value 13
Let us look at an example 14
Suppose we want to get all the customers 15
Whose age is between 20 and 30 16
This can be done using the between condition 17
Select everything from the customer table where 18
Age is between 19
20 and 30 20
Latest go and write this in the PG admin interface 21
Select 22
Star from customer 23
Where 24
Age 25
Between 26
Lower value 27
And upper value 28
Run this command 29
You can see 30
Only customers who have age between 20 and 30 31
Are Remaining 32
Important thing to note here is 33
Both the value 20 and 30 34
Are included 35
Customer with the age of 20 years 36
Will be part of this retrieve data set 37
This same result can be 38
Retrieved using the and statement, So if I write select star from 39
Customer where 40
Age greater than equal to 20 41
And age less than equal to 42
30 43
Running this command will give us back the same result 44
Now 45
The between statement can also be clubbed with the not statement. Let us look at the syntax of how 46
We can club not and between statement 47
We'll write select star from customer 48
Where age not between 20 and 30 49
As you can guess what this will do it 50
We will get back all the customers whose age is not between 51
20 years and 30 years. Let's go and run this query 52
Customer table where 53
Age not between 54
20 and 30 55
Run this command 56
You can see 57
All the customers 58
That we have in our retrieve data set 59
Do not belong to the 60
Age category of 20 to 30 61
Also another thing you can note is 62
Between statement can be used 63
With dates also 64
If you want to find out 65
All the data. 66
Which belong 67
To a particular time range 68
For example, if you want to find out all the orders 69
That u shipped 70
Between a particular time range say 71
Between 1st April 2015 72
To 1st April 2016 73
You can find that using the between statement such as this 74
Select star from sales 75
Ship Date 76
Between 77
This is the lower value of the date 1st April 2015 78
And that is the upper value 1st April 2016 79
Note the format of date 80
It is YYYY 81
MM DD, first the year then the month then the date so let's go and write this query 82
From 83
This is the sales table 84
Where ship date between 85
2015 04 01 86
And 87
Remember to put single quotation mark around the date values and 88
Single code 2016 04 01 89
And select this command and run it 90
You can see 91
The ship date 92
Column has only the values which belong to this 93
Date range 94
That is how we use the between statement
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.