+ 1

LIMIT and BETWEEN are the same?

3rd Nov 2016, 4:58 PM
Shashank Chaudhari
Shashank Chaudhari - avatar
6 Respostas
+ 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.
19th Nov 2016, 3:18 AM
Ben
+ 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.
3rd Nov 2016, 5:05 PM
Ruslan Madatov
Ruslan Madatov - avatar
+ 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
22nd Nov 2016, 11:15 AM
chanikya pulagam
chanikya pulagam - avatar
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
4th Nov 2016, 6:57 AM
Sudhakar Narayana Boya
0
Hi shashank limit is inclusive of the range that u give whereas between does not include the range
9th Nov 2016, 7:00 AM
Ankita Saxena
Ankita Saxena - avatar
0
no both are not same
2nd Dec 2016, 5:35 AM
kajal joshi