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 is mySQL. Is there any specific qualification required to do this course ? What is the scope in India after doing mySQL
Which is better mysql or mssql?
Is microsoft sql same as mysql?
Which is faster mysql or mongodb?
Why to use char instead of varchar in the database?
How many ways to get the current time?
What are procedures in mysql? Explain
suppose data is copie to oracle to sql by using DTS. Actully it taken 2 hours. suppose some day distribute the server in the middle of 2 hours. after how can i get the data ?
How to get a list of columns in an existing table?
what is mysql optimization in brief?
how to take mysql database backup?
If we use sum function in mysql, does it return sum of that row or for that column?
write a query to mysql in safe mode and to change the root password
How to use sum function in where clause in mysql?
How will you export tables as an xml file in mysql?