Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What are the features of mysql?

944


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

1281


Is mysqli secure?

834


Why is mysql popular?

832


Can you tell which of the following where clauses is faster?

842


What is bigint in mysql?

865


What is offset limit?

908


What is dump in mysql?

823


Write a program using the select statement, while loop.

864


How to drop an existing table in mysql?

962


How to Change a users password from unix shell.

1025


What is the use of concat() in mysql?

931


How do I check mysql version?

955


What does a TIMESTAMP do on UPDATE CURRENT_TIMESTAMP data type?

882


Can mongodb replace mysql?

889