• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

count calculation on the matching of date

 
Ranch Hand
Posts: 1283
Netbeans IDE Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have this query where I am counting values from three different tables and getting two columns, date and count from each of it. Getting 3 records for first 12 for second and 12 for third. Finally I am doing little calculation from this count columns from all these table where there date from the second column is finding a match..

For eg if date of first table column is matching with second and third one I am adding all these values and getting percentage of it… though I ‘ve created a query for it…but it is got giving correct data..

I need to know how could I perform calculation form this table on the basis of date.. I am using oracle DB

 
Kaustubh G Sharma
Ranch Hand
Posts: 1283
Netbeans IDE Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
count1
------------------
count | date
3 | 12/12/1928
5 | 12/12/1998
6 | 12/12/1995




count2
------------------
count| date
3 | 12/12/1928
5 | 12/12/1998
6 | 12/12/1995
23 | 12/12/1924
56 | 12/12/1993
68 | 12/12/1992
39 | 12/12/1921
58 | 12/12/1990
63 | 12/12/1999


count3
------------------
count| date
3 | 12/12/1928
5 | 12/12/1998
6 | 12/12/1995
23 | 12/12/1924
56 | 12/12/1993
68 | 12/12/1992
39 | 12/12/1921
58 | 12/12/1990
63 | 12/12/1999


count4
------------------
4500


now I have to calculate

(count1+count2+count3)*100/count4
when count1.date=count2date=count3.date


HTH
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic