Get the top row after order by in Oracle Subquery

前端 未结 4 1565
一整个雨季
一整个雨季 2021-02-15 17:19

I have a table student(id, name, department, age, score). I want to find the youngest student who has the highest(among the youngest students) score of each department. In SQL S

4条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-15 18:19

    select to_char(job_trigger_time,'mm-dd-yyyy') ,job_status from
    (select * from kdyer.job_instances ji INNER JOIN kdyer.job_param_values pm 
    on((ji.job_id = pm.job_id) and (ji.job_spec_id = '10003') and (pm.param_value='21692') )
    order by ji.job_trigger_time desc)
    where rownum<'2'
    

提交回复
热议问题