• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

count calculation on the matching of date

 
Kaustubh G Sharma
Ranch Hand
Posts: 1283
Chrome Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • 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
Chrome Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic