Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Acessing adjacent rows and calculating time diffre

Author  Topic 

rohandreamworld
Starting Member

2 Posts

Posted - 2010-05-17 : 05:38:03
Hi everyone I am using Syabse databse.
I have designed a table of following format
quote:
DateTime feed_name msg_rate


I want to write a query for calculating Busy minute of day,
Busy minute mean when for particular one min msg_rate has to be maximum and generally DateTime field is stored at the interval of 30 sec.I have to acess table in sequential order and for a particular day i have to calculate busy day???


Can anyine tell me how to do this??????
Database used is Sybase

Sachin.Nand

2937 Posts

Posted - 2010-05-17 : 05:50:47
This is an MS SQL forum.For issues regarding Sybase please post your questions here

http://www.dbforums.com/sybase/

PBUH
Go to Top of Page

rohandreamworld
Starting Member

2 Posts

Posted - 2010-05-17 : 06:01:14
Hey can u tell me SQL query for that, i can modify it into Sybase
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2010-05-17 : 06:05:50
does Sybase has row_number() equivalent ?


select *
from (
select *, row_no = row_number() over (partition by dateadd(day, datediff(day, 0, datecol), 0)
order by msg_rate desc)
from yourtable
) t
where t.row_no = 1



KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page
   

- Advertisement -