• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

query database/output count and summation to servlet?

 
Nicole Jones
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have this database query that adds the total dollar amount by funder and counts the number of projects per funder. obviously, neither the total or the count is stored in my database....should it be? because how would i access the count and total from a servlet if neither are stored the database?

here is my query:

Any help will be greatly appreciated.
 
Nicole Jones
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nevermind, doh. I figured it out.

This is the desired query:



code to set the alias columns:

 
Paul Clapham
Sheriff
Pie
Posts: 20729
30
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yep, that should work fine. Here's another method which doesn't require aliases for the computed columns:

(The columns are numbered from left to right in the query, starting at 1.)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic