File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes doubt in a query Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "doubt in a query " Watch "doubt in a query " New topic
Author

doubt in a query

shyamkumar bopannachengalaiah
Ranch Hand

Joined: Dec 30, 2008
Posts: 100
I am working on a application where pagination is used for navigating the content of a chapter.I have a database table which contains the subjectname say (science) it has chapters like chap1,chap2,chap3,chap4 and each chapter contains some 5 pages . Now my problem is How can i get the exact number of (count) page number 4 of the chapter number chap3 using sql query. That is say chap1 contains 5 pages when taking next page count it has to be read as 6 from chapter 2 like this goes on so totally there are 20 pages for 4 chapters. So nw how can i get the count number as 16 using mysql query?
Balu Sadhasivam
Ranch Hand

Joined: Jan 01, 2009
Posts: 874

Shyam,

Explain your database columns and values. If you are looking for count of records in a table.
,

this would give you exact no of records available for the Science subject ordered by different chapters. But cant guess more without any information on Table structure..
shyamkumar bopannachengalaiah
Ranch Hand

Joined: Dec 30, 2008
Posts: 100
Balu Sadhasivam wrote:Shyam,

Explain your database columns and values. If you are looking for count of records in a table.
,

this would give you exact no of records available for the Science subject ordered by different chapters. But cant guess more without any information on Table structure..

Sorry i need the position of the page number 4 of the chap3. How can i get this?
Balu Sadhasivam
Ranch Hand

Joined: Jan 01, 2009
Posts: 874



Sorry i need the position of the page number 4 of the chap3. How can i get this?


I dint get what you mean. Explain your database columns and values.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19718
    
  20

Moving to JDBC.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30751
    
156

Please share your table definition more details. On a high level, you have:
select count(*) from table where chapter <= ?


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: doubt in a query