Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Help with the Query

 
Kishen Singh Punjabi
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have the following results from a query,

Key - Value
--------------
A - 1155
B - 1244
C - 1211
D - 1312
-------------

Is it possible to have the total Row at the bottom like below


Key - Value
--------------
A - 1155
B - 1244
C - 1211
D - 1312
-------------
Total - XXXX

Please help with the query.

Thanks in Advance!!!

 
Kishen Singh Punjabi
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guys any help..?
 
Rob Spoor
Sheriff
Posts: 20827
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's probably possible using a UNION:

You may have to cast the key if it's a numeric type, otherwise the UNION will most likely cause an error due to incompatible types.
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!