dbTalk Databases Forums  

analytical functions

comp.databases.sybase comp.databases.sybase


Discuss analytical functions in the comp.databases.sybase forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
hrishy
 
Posts: n/a

Default analytical functions - 02-06-2004 , 01:16 AM






Hi

Does sybase 12.5 or above suport analytical functions.I am looking for
sybase adaptive server enterprise and not IQ


can i do something like this

with ranked_years (year, sum, rank) as
(select year(date) as year, sum(sales) as sum,
rank() over (order by sum(sales) desc) as rank
from sales
group by year(date)
)
select year, sum, rank
from ranked_years
where rank <= 3;
YEAR SUM RANK
----------- ------------- -------
1995 7731162.39 1
1997 7211584.76 2
1999 6278023.54 3


regards
Hrishy

Reply With Quote
  #2  
Old   
hrishy
 
Posts: n/a

Default Re: analytical functions - 02-15-2004 , 12:55 AM






Hi All

Anything on this yet..or it is supported only on sybase IQ and not sybaseASE

regards
Hrishy



hrishys (AT) yahoo (DOT) co.uk (hrishy) wrote in message news:<4ef2a838.0402052316.5ab121cc (AT) posting (DOT) google.com>...
Quote:
Hi

Does sybase 12.5 or above suport analytical functions.I am looking for
sybase adaptive server enterprise and not IQ


can i do something like this

with ranked_years (year, sum, rank) as
(select year(date) as year, sum(sales) as sum,
rank() over (order by sum(sales) desc) as rank
from sales
group by year(date)
)
select year, sum, rank
from ranked_years
where rank <= 3;
YEAR SUM RANK
----------- ------------- -------
1995 7731162.39 1
1997 7211584.76 2
1999 6278023.54 3


regards
Hrishy

Reply With Quote
  #3  
Old   
Ram DSL
 
Posts: n/a

Default Re: analytical functions - 02-16-2004 , 08:04 AM



Hrishy,
I dont know about 'with', Its totally new to me. But I'm sure its not
possible to use this in ASE. I'm not sure about IQ. Can you help me to
find the syntax of with.
Regards,
Ram DSL, London.
www.dslsoft.net



hrishys (AT) yahoo (DOT) co.uk (hrishy) wrote in message news:<4ef2a838.0402142255.2fe021be (AT) posting (DOT) google.com>...
Quote:
Hi All

Anything on this yet..or it is supported only on sybase IQ and not sybaseASE

regards
Hrishy



hrishys (AT) yahoo (DOT) co.uk (hrishy) wrote in message news:<4ef2a838.0402052316.5ab121cc (AT) posting (DOT) google.com>...
Hi

Does sybase 12.5 or above suport analytical functions.I am looking for
sybase adaptive server enterprise and not IQ


can i do something like this

with ranked_years (year, sum, rank) as
(select year(date) as year, sum(sales) as sum,
rank() over (order by sum(sales) desc) as rank
from sales
group by year(date)
)
select year, sum, rank
from ranked_years
where rank <= 3;
YEAR SUM RANK
----------- ------------- -------
1995 7731162.39 1
1997 7211584.76 2
1999 6278023.54 3


regards
Hrishy

Reply With Quote
  #4  
Old   
hrishy
 
Posts: n/a

Default Re: analytical functions - 02-17-2004 , 01:32 AM



Hi Ram

This with syntax is avalibale in other RDBMS like Db2 and oracle..They
are called common table expressions part of ANSI SQL.u can serach
www.ibm.com/developerworks under db2 articles for that

regards
Hrishy

reachram (AT) bharatmail (DOT) com (Ram DSL) wrote in message news:<f1565749.0402160604.81f81cc (AT) posting (DOT) google.com>...
Quote:
Hrishy,
I dont know about 'with', Its totally new to me. But I'm sure its not
possible to use this in ASE. I'm not sure about IQ. Can you help me to
find the syntax of with.
Regards,
Ram DSL, London.
www.dslsoft.net



hrishys (AT) yahoo (DOT) co.uk (hrishy) wrote in message news:<4ef2a838.0402142255.2fe021be (AT) posting (DOT) google.com>...
Hi All

Anything on this yet..or it is supported only on sybase IQ and not sybaseASE

regards
Hrishy



hrishys (AT) yahoo (DOT) co.uk (hrishy) wrote in message news:<4ef2a838.0402052316.5ab121cc (AT) posting (DOT) google.com>...
Hi

Does sybase 12.5 or above suport analytical functions.I am looking for
sybase adaptive server enterprise and not IQ


can i do something like this

with ranked_years (year, sum, rank) as
(select year(date) as year, sum(sales) as sum,
rank() over (order by sum(sales) desc) as rank
from sales
group by year(date)
)
select year, sum, rank
from ranked_years
where rank <= 3;
YEAR SUM RANK
----------- ------------- -------
1995 7731162.39 1
1997 7211584.76 2
1999 6278023.54 3


regards
Hrishy

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.