morinia
asked on
Select within a select in Oracle
Experts,
I have seen the code before where partition by is used in an Oracle Query to get row_num and there is another query concatanated to it to get other columns within the table where row_num = 1. Can someone give me the syntax for this? I believe it looks something like this:
Select row_number() over (partition by member_id ORDER BY date_entered DESC) rownum FROM
Select member_id
, claim
, date_entered
FROM TABLEA
where rownum = 1;
quit;
I have seen the code before where partition by is used in an Oracle Query to get row_num and there is another query concatanated to it to get other columns within the table where row_num = 1. Can someone give me the syntax for this? I believe it looks something like this:
Select row_number() over (partition by member_id ORDER BY date_entered DESC) rownum FROM
Select member_id
, claim
, date_entered
FROM TABLEA
where rownum = 1;
quit;
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Otherwise check: Oracle® Database SQL Language Reference
11g Release 2 (11.2) Analytical Functions
:p