![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I have an Oracle 9i table containing details of "courses taken": |
| In SQL server I would use row_number(), example: WITH CTE AS ( SELECT CourseCode, StudentID, DateAttended, Grade, rowno = row_number() OVER(PARTITION BY CourseCode ORDER BY DateAttended DESC) FROM Courses ) SELECT CourseCode, StudentID, DateAttended, Grade FROM CTE WHERE rowno = 1 |
|
But what do I use in Oracle? Thanks. |
#3
| |||
| |||
|
|
I doubt that SQL Server would require such a clumsy construct. This query would also be perfectly legal in the Oracle world. Please note that logic is deeply flawed. You are ordering the grades and selecting only the first rows, instead of just selecting the maximum. Thanks for the help and the code. Apologies for posting in the wrong |
#4
| |||
| |||
|
|
On Aug 21, 7:12*pm, Mladen Gogala <gogala.mla... (AT) gmail (DOT) com> wrote: I doubt that SQL Server would require such a clumsy construct. This query would also be perfectly legal in the Oracle world. Please note that logic is deeply flawed. You are ordering the grades and selecting only the first rows, instead of just selecting the maximum. Thanks for the help and the code. Apologies for posting in the wrong group... It's not "homework"! I've been out of "school" for a long time :- What groups are more suited to PL/SQL questions? Thanks again for your response... |
![]() |
| Thread Tools | |
| Display Modes | |
| |