View previous topic :: View next topic |
Author |
Message |
gotluru Beginner
Joined: 17 Dec 2002 Posts: 29 Topics: 6
|
Posted: Thu Mar 27, 2003 11:29 am Post subject: OLAP Funtions |
|
|
Hi All,
I am getting syntax error when i am trying rank function.
Do we need OLAP Server to run?
Please clarify me..
My SQL:
Code: |
--------------------------------------------------------------------------------
SELECT ID, MBR_ID, AMT, RANK() OVER (PARTITION BY ID ORDER BY AMT) AS RANK FROM table;
----------------------------------------------------------------------------- SQL0104N An unexpected token "(" was found following "". Expected tokens may include: ", FROM INTO ". SQLSTATE=42601 |
--------------------------------------------------------------------------------
Thanks,
--------------------
Prasad
Last edited by gotluru on Thu Mar 27, 2003 2:23 pm; edited 1 time in total |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12377 Topics: 75 Location: San Jose
|
Posted: Thu Mar 27, 2003 1:38 pm Post subject: |
|
|
Prasad,
I have never worked with OLAP functions, but the syntax looks a little odd for me.
In DB2 you cannot use ORDER BY without selecting the column.In your query you had ORDER BY AMT whereas the AMT is not being selected.I beleive that the same rules apply for OLAP also
Check this link for using OLAP functions.
http://www7b.boulder.ibm.com/dmdd/library/techarticle/lyle/0110lyle.html
Hope this helps...
cheers
kolusu |
|
Back to top |
|
 |
gotluru Beginner
Joined: 17 Dec 2002 Posts: 29 Topics: 6
|
Posted: Thu Mar 27, 2003 2:25 pm Post subject: |
|
|
Hi Kolusu,
Thanks for your response.
I missed amount field in my earlier post. I added amt field, still i am getting the same error.
Thanks,
Prasad |
|
Back to top |
|
 |
|
|