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
How do I drop a database in mysql?
What is root password?
Describe mysql transaction properties.
What is the maximum size of table in mysql?
How to change the database engine in mysql?
Is mysql case-sensitive?
What are the benefits of mysql?
Is mysql relational database?
How to decrement dates by 1 in mysql?
What is delimiter in mysql stored procedure?
What are the different types of triggers in mysql?
What is the maximum number of columns per table?
Does mysql case matter?
Can we store pdf files in mysql?
How can I create table in mysql?