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
In which format data is stored in mysql database?
What is horizontally scalable?
What are the column comparisons operators?
How do I clear the command in mysql?
What is difference between group by and order by clause?
Why do we use preparedstatement?
What language is used in mysql?
How to use count function in mysql?
How to write after insert event update trigger on the same table in mysql?
How to dump a table from a database.
what is database black box testing? : Mysql dba
What causes mysql too many connections?
Write a query to find duplicate rows in table?
Write a command to view mysql database table structure?
How to do login in mysql with unix shell.