Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > MySQL
| Search | Today's Posts | Mark Forums Read
MySQL General discussion about the MySQL database.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the MySQL section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 21st, 2007, 12:51 AM
Registered User
 
Join Date: Mar 2007
Location: , , .
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default To retrieve a row by giving row number

Hi everyone
  I'm new to MySQL, Is there any query in MySQL than can display a single row when given its row number. for example there are 100 rows , when given the row number as 81 , it has to display all the records in the 81 row. I'm using the query given below. but its not working.

"SELECT ROW_NUMBER() OVER (ORDER BY id ASC) AS rn, * from myTable where rn = " + rowNo + " ORDER BY columnName"


Someone please help me,
Thanks in advance,
Pradeep
 
Old March 22nd, 2007, 11:20 PM
Friend of Wrox
 
Join Date: Jul 2003
Location: South San Francisco, CA, USA.
Posts: 128
Thanks: 0
Thanked 1 Time in 1 Post
Default

Prad,
First you need to learn the SQL syntax for selecting rows in a table.
In your example assuming your first field in your table is the row number named Id.

The syntax will be:

SELECT * FROM tablename WHERE Id = 81;

Get the MySQL Beginner's book from WROX it is more than it's worth.
And your gained knowlege will be for life.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Scrollbar in row of Datagrid Except Header Row Theone84 ASP.NET 2.0 Professional 0 August 11th, 2008 12:10 AM
Serial Number with each table row ketannsharma Access 3 March 16th, 2007 06:44 AM
help in xsl getting row number pandian XSLT 6 January 23rd, 2006 10:00 AM
Read a column and Search Row by Row in another col AyatKh Excel VBA 2 January 26th, 2005 12:02 PM
Select row number N 1kHz SQL Language 4 December 27th, 2004 06:22 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.