sql001
原查询结果如下:
要求实现如下
sql语句如下:
select case when rnum in
(
select to_char(min(rnum)) as rnum from ( select rownum as rnum, jh,kgrq,rq from 表名
where jh='9L116-05' and kgrq=to_date('2000-1-16','yyyy-mm-dd') order by rq)
group by rq
) then to_char(rq,'yyyy-mm-dd') else '' end as rq ,kgrq,jh from
(select rownum as rnum, jh,kgrq,rq from 表名
where jh='9L116-05' and kgrq=to_date('2000-1-16','yyyy-mm-dd') order by rq)
实现效果如下: