how to display only 4 records from a table based on a
condition
for ex
i have a table called products
in that nid,prodname are fields
i want to display only any 4 records of perticular product
plz tell me
Answer Posted / sql
Definition: Limit is used to limit your MySQL query results
to those that fall within a specified range. You can use it
to show the first X number of results, or to show a range
from X - Y results. It is phrased as Limit X, Y and included
at the end of your query. X is the starting point (remember
the first record is 0) and Y is the duration (how many
records to display).
Also Known As: Range Results
Examples:
SELECT * FROM `your_table` LIMIT 0, 10
This will display the first 10 results from the database.
SELECT * FROM `your_table` LIMIT 5, 5
This will show records 6, 7, 8, 9, and 10
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What are the features of mysql?
table a has records 1,1,1,1 table b has records 1,1,1,1,1,1 what would be out if perform join for all cases
Is mysqli secure?
Why is mysql popular?
Can you tell which of the following where clauses is faster?
What is bigint in mysql?
What is offset limit?
What is dump in mysql?
Write a program using the select statement, while loop.
How to drop an existing table in mysql?
How to Change a users password from unix shell.
What is the use of concat() in mysql?
How do I check mysql version?
What does a TIMESTAMP do on UPDATE CURRENT_TIMESTAMP data type?
Can mongodb replace mysql?