Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

doubt in a query

 
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?
 
Ranch Hand
Posts: 874
Android VI Editor Java
  • 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 VI Editor Java
  • 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.
 
Sheriff
Posts: 21951
106
Eclipse IDE Spring VI Editor Chrome Java Ubuntu Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to JDBC.
 
author & internet detective
Posts: 39997
807
Eclipse IDE VI Editor Java
  • 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 <= ?
 
My previous laptop never exploded like that. Read this tiny ad while I sweep up the shards.
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic