+ 1
LIMIT and BETWEEN are the same?
6 Answers
+ 6
BETWEEN will likely be found in the WHERE clause. It sets a condition or filter for your data. For example:
SELECT * FROM tableA
WHERE date BETWEEN '2016-01-01' AND '2016-12-31'
This will only include records in tableA that have a date between Jan 1 and Dec 31, 2016.
LIMIT is a separate clause that limits the number of records returned by your query. For example:
SELECT * FROM tableA
LIMIT 10
This will return only 10 records based on their order in the table. Use ORDER BY to sort based on a field and then use LIMIT 'x' to select the top or bottom 'x' number of records based on your ordering.
+ 2
of course not. Between is condition. You can write select * from user where age between 18 and 20 limit 10
you select 10 users which age is between 18 and 20.
+ 1
Limit and Between are not same
Limit restricts the number of records that satisfies the condition to a particular value.
Between prints the records within the given boundaries
0
no both are different, between can be used to select or filter the data with in a certain range where as limit can restrict the selected data using a limit value
0
Hi shashank limit is inclusive of the range that u give whereas between does not include the range
0
no both are not same