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)
 analytical functions in sql server

Author  Topic 

sqlguy
Starting Member

1 Post

Posted - 2007-03-21 : 14:12:13
I am joining to a table where I need the latest tier code. In oracle, we have analytical functions such as rank, lead etc. Is there such a function in sql server.

select a.ID, b.tier_code (get the oldest tier code here)
from table_a, table_b
where a.ID = b.ID

Can this be achieved without using a group by? what is the best way to achieve this?

thanks

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-03-21 : 14:20:56
You have RANK(), DENSE_RANK(), NTILE(), ROW_NUMBER() in SQL Server.


Peter Larsson
Helsingborg, Sweden
Go to Top of Page
   

- Advertisement -