wood burning stoves 2.0*
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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: 19651
    
  18

Moving to JDBC.


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

Joined: May 26, 2003
Posts: 30076
    
149

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
 
Similar Threads
Time record for jsp
to view multiple pages of a file or document
Create GUI from and saving stuff to XML
Map, Hashmap: when would one use them?
Handling PDF files