MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

OLAP Funtions

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
gotluru
Beginner


Joined: 17 Dec 2002
Posts: 29
Topics: 6

PostPosted: Thu Mar 27, 2003 11:29 am    Post subject: OLAP Funtions Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12377
Topics: 75
Location: San Jose

PostPosted: Thu Mar 27, 2003 1:38 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
gotluru
Beginner


Joined: 17 Dec 2002
Posts: 29
Topics: 6

PostPosted: Thu Mar 27, 2003 2:25 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group