0
What is difference between ' between function' and limit?
3 Answers
+ 3
between is used with where clause but limit can used with out where clause
+ 2
BETWEEN is used to select/filter entries with a certain interval of values of an attribute with a continuous range, like numbers or dates. For example, you want to see all customers between the ages of 18 and 30. Your query will look like:
SELECT name, age FROM customers WHERE age BETWEEN 18 AND 30
LIMIT is used to show only a certain amount of results out of all the results of your query. Say, we got 200 results from the previous query, but we only want to see the first 25. For that you just add LIMIT to your query like:
SELECT name, age FROM customers WHERE age BETWEEN 18 AND 30 LIMIT 25
and you'll see only the first 25 entries matching your WHERE criteria.
0
By using Between you can give a range from starting number to end. But Limit is different than Between. By using Limit you can select top n rows from the table.