SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 filtering
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Rliss
Starting Member

31 Posts

Posted - 04/17/2007 :  15:15:48  Show Profile  Reply with Quote
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

USA
37466 Posts

Posted - 04/17/2007 :  15:28:44  Show Profile  Visit tkizer's Homepage  Reply with Quote
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/

Edited by - tkizer on 04/17/2007 15:29:48
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000