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 2000 Forums
 SQL Server Development (2000)
 ROW_NUMBER QUESTION

Author  Topic 

shifis
Posting Yak Master

157 Posts

Posted - 2006-03-28 : 21:03:21
How can I do something like this (Oracle), I don't know if there is any funtion like ROW_number in SQL Server 2000.

SELECT CALIFICACION
FROM
( SELECT ROW_NUMBER() OVER(PARTITION BY EMPLOYEE_ID
ORDER BY DT_COURSE DESC,FOLIO_COURSE DESC) THE_ROW,
RH_CURSO.CALIFICACION
FROM RH_CURSO
WHERE RH_CURSO.DT_COURSE < TO_DATE ('03/27/2006','MM/DD/YYYY')
RH_CURSO.COURSE=150
)
WHERE THE_ROW = 1;


This query returns the qualification per employee of the last time that the employee took the course number 150.
The employee can take a course more then one time per day.

( Hope you undestand my English, thanks!!)

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-03-29 : 02:18:59
Row number is not supported in sql server 2000 but available in sql server 2005
Use Front end application to number the results

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

shifis
Posting Yak Master

157 Posts

Posted - 2006-03-29 : 11:44:59
What is a Front end application ?
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2006-03-29 : 12:18:39
your client app.
sql server is a server that holds the data and sends them to the client.
a front end is a client that receives the data.
it can be any app that queries the sql server or query analyzer or enterprise manager...

Go with the flow & have fun! Else fight the flow
Go to Top of Page
   

- Advertisement -