in the LIMIT section it is said that the offset starts from 0 then why in this BETWEEN section rhe example is not like that...we are declaring from 3 to 7 and it is displaying from 3-7...as per said in the LIMIT it must have started from 4...can anyone explain this please??? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

in the LIMIT section it is said that the offset starts from 0 then why in this BETWEEN section rhe example is not like that...we are declaring from 3 to 7 and it is displaying from 3-7...as per said in the LIMIT it must have started from 4...can anyone explain this please???

8th Aug 2016, 12:47 AM
Gadagoju Prudhvi
Gadagoju Prudhvi - avatar
2 Answers
+ 1
Yes, you have a valid doubt.. But the thing is in limit we are not specifing any column name, by default SQL start counting row number.. And it stated that row number start from zero. So that's why limit starts from zero... On other hand, in BETWEEN we specify column name.. So SQL will search for that column and in that column it will search for the value we have written in our condition... And starts from there only.. In short limit, counts the row number and between will search for our specified value.
8th Aug 2016, 7:54 AM
Hardik Thaker
Hardik Thaker - avatar
+ 1
thank you....now I got the clarity :-)
8th Aug 2016, 12:28 PM
Gadagoju Prudhvi
Gadagoju Prudhvi - avatar