Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mysql numrow

Status
Not open for further replies.

lleemon

Programmer
Mar 26, 2002
21
GB
In Oracle you can do the following and only return the first 5 records:
select *
from tablename
where rownum = 5;

Does anyone know if you can do the same thing in MySql? I have heard of a numrow but was unable to find this on the MySql site. If anyone can send me a sample of how to do this I would be very greatful.

Thanks in advance.
 
in mysql there's the LIMIT keyword for this:

select * from table LIMIT 5

 
or in mySQL you can select some of the records using LIMIT 10,20 which gives record 10 thru record 20 inclusive. ***************************************
Party on, dudes!
[cannon]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top