File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes About Computer Sum Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "About Computer Sum" Watch "About Computer Sum" New topic
Author

About Computer Sum

Tom Keaton
Greenhorn

Joined: Feb 24, 2004
Posts: 17
I use sql like this:
SELECT type, price, advance

FROM titles

WHERE type LIKE '%cook'

ORDER BY type

COMPUTE SUM(price), SUM(advance) BY type



Here is the result set:

type price advance

------------ -------------------------- --------------------------

mod_cook 19.99 0.00

mod_cook 2.99 15,000.00



sum

==========================

22.98

sum

==========================

15,000.00



type price advance

------------ -------------------------- --------------------------

trad_cook 20.95 7,000.00

trad_cook 11.95 4,000.00

trad_cook 14.99 8,000.00



sum

==========================

47.89

sum

==========================

19,000.00



(7 row(s) affected)



but I only find two records use CDaoRecordset::GetRecordCount


undefined
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: About Computer Sum
 
Similar Threads
counting items in an array
Writing a method for different kinds of primitives
Performing math equations within arrays
Getting totals of rows in SQL
method with an unknown number of parameters