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
 SQL Server 2005 Forums
 Transact-SQL (2005)
 filtering

Author  Topic 

Rliss
Starting Member

31 Posts

Posted - 2007-04-17 : 15:15:48
this query selects the top 10 of all rows. Now I am required to toss out the highest, hence, I need to select row 2 - row 11. Any easy to do this without creating another layer?

select TOP 10 linkset_name LinkDesc1,
start_date_time LinkDesc2,
high_pct_occupancy ,
(trans_isup_oct/trans_bandwidth)*100 Tisup,
(trans_sccp_oct/trans_bandwidth)*100 Tsccp,
(trans_other_oct/trans_bandwidth)*100 Tother,
(recv_isup_oct/recv_bandwidth)*100 Risup,
(recv_sccp_oct/recv_bandwidth)*100 Rsccp,
(recv_other_oct/recv_bandwidth)*100 Rother
FROM [LinkOccupancy].[dbo].[LINKSET_DAILY_HIGH_VIEW]
WHERE START_DATE_TEXT = '20061011'
ORDER BY HIGH_PCT_OCCUPANCY DESC;

Thanks,

RLiss

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2007-04-17 : 15:28:44
http://www.sqlteam.com/item.asp?ItemID=566

Or you could get rid of the top one by finding the top 10 after the max by using a where clause with a subquery.

Tara Kizer
http://weblogs.sqlteam.com/tarad/
Go to Top of Page
   

- Advertisement -