0 pts.
 Help using oracle Analytical function.
I am trying to create a query that will do two parallel select from the data available. I want to write one select statement using analytical functions, What I want to do is as follows: I one single query I want to find out the count of the transactions in the last 7 days from sysdate and last 6 months from sysdate. The table has got transactions and the corresponding dates. I am new with the analytical functions and finding it difficult to understand the use of the 'order' and 'range' options. It will be great if someone can write the above query with an explanation how it works. Thanks

Software/Hardware used:
ASKED: October 16, 2005  7:16 PM
UPDATED: October 28, 2005  9:06 AM

Answer Wiki:
Analytic functions are cool; it is however tricky to get them right. The query skeleton below should work for you: select (select count(1) from tab_name where trans_date between sysdate - 7 and sysdate) seven_days_count, (select count(1) from tab_name where trans_date between sysdate - 180 and sysdate) six_month_count from dual ; ++ Olu
Last Wiki Answer Submitted:  October 28, 2005  9:06 am  by  Oadegoke   0 pts.
All Answer Wiki Contributors:  Oadegoke   0 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _