This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

query database/output count and summation to servlet?  RSS feed

 
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
Posts: 22374
42
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
Boost this thread!