Home » SQL & PL/SQL » SQL & PL/SQL » Missing the Window specification
Missing the Window specification [message #19040] Tue, 26 February 2002 20:24 Go to next message
Milind S Deobhankar
Messages: 33
Registered: January 2002
Member
Hi

One error comes Missing Window specification , I would like to know that what is window specification for any fucntion i had not knowing what is the window specification can any body help me regarding the same.

The error number is not avialable in the error messages in the documentation.

The function ratio_to_report actually calculates the percentage of individual row corresponding to the sum of each row in column.

Here is the complete code for the same:

create table test100
(amount number)
/
select amount from test100;
AMOUNT
----------
100
500
select ratio_to_report(amount) over() from test100;
RATIO_TO_REPORT(AMOUNT)OVER()
-----------------------------
.166666667
.833333333

select ratio_to_report(amount) over()*100 from test100;
RATIO_TO_REPORT(AMOUNT)OVER()*100
---------------------------------
16.6666667
83.3333333
select ratio_to_report(amount) from test100;
select ratio_to_report(amount) from test100
*
ERROR at line 1:
ORA-30484: missing window specification for this function
Re: Missing the Window specification [message #19050 is a reply to message #19040] Wed, 27 February 2002 01:34 Go to previous message
pratap kumar tripathy
Messages: 660
Registered: January 2002
Senior Member
ratio_to_report is an analytic function. and here is some fact about this tyepe of function.hope it helps

Analytic functions compute an aggregate value based on a group of rows. The
group of rows is called a window and is defined by the analytic clause. For each
row, a "sliding" window of rows is defined. The window determines the range of
rows used to perform the calculations for the "current row". Window sizes can be
based on either a physical number of rows or a logical interval such as time.

Analytic functions are the last set of operations performed in a query except for the
final ORDER BY clause. All joins and all WHERE, GROUP BY, and HAVING clauses are
completed before the analytic functions are processed. Therefore, analytic functions
can appear only in the select list or ORDER BY clause.
Previous Topic: Input Truncate
Next Topic: Dynamic query to cursor
Goto Forum:
  


Current Time: Fri Mar 29 07:08:34 CDT 2024