Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

doubt in a query

 
shyamkumar bopannachengalaiah
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 874
Android Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 874
Android Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


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
Pie
Posts: 20532
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to JDBC.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34410
346
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please share your table definition more details. On a high level, you have:
select count(*) from table where chapter <= ?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic