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
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 Till now, we have seen how to filter and sort results 1
Now 2
We'll learn how to limit the 3
Number of 4
Rows that you are getting in a resultset 5
Why it is important 6
Sometimes our server has over million records 7
And when we are trying to retrieve it it will take a lot of time 8
So to limit the number of rows that you get in your result set 9
We'll be using the 10
Limit statement 11
This is the syntax to use the limit statement 12
Select the column names that you want from the table name 13
Specific any condition if any 14
Then 15
You can order the results if you want to 16
Then you specify limit 17
And then you give the row count, the number of rows that you want 18
For example 19
If you want to find out the top eight 20
Most aged customers in your database 21
How do you do that 22
We'll select the customers 23
With age > 25 that's a condition that is not 24
Necessary but 25
I have Just put it 26
Then you will order it in the descending order of age because we want the customer to have the maximum age 27
Then we'll put a limit of 8 so it will give back only 8 customers 28
Let's go and write this in the PG admin interface 29
I am starting with the 30
Limit lecture 31
Select 32
Star 33
where Age is greater than 25 34
Order by age descending 35
Limit, we only need 8 customers so 8 36
We run it 37
You can see 38
Only 8 39
Rows are returned 40
Others are not return and the age of customer 41
is the maximum 42
So it was arranged in descending order 43
And after that only top 8 rows were returned 44
Now 45
IF you want to get 46
The 47
Customers who have the least age 48
We'll use the same query 49
We'll just arrange them in the ascending order 50
And we'll change the limit to 10 if you want to 51
Find out 10 customers 52
So we'll write select star from customer 53
We put the condition of 25 also so that 54
All the customers 55
Who have age more than 25 56
And starting with 57
The minimum age 58
Limit 10, so it will give me the top 10 customers 59
These are the 10 customers 60
Whose age is Greater than 25 61
So all of the customers have 26 years of age 62
And it is arranged in ascending order 63
And only 10 records are written 64
So that is how we using limit statement 65
It will limit the number of records that we get back 66
This 67
Statment will be very handy when you are handling large data sets 68
In the next lecture we'll learn how to give 69
Second names or 70
Aliases to the column names
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.