摘要: CREATE OR REPLACE Procedure SP_GETSUMMARY_OILTUBE(well in varchar2,kgsj in varchar2,p_cursor out ego.cursorType)as begin open p_cursor for select decode(xh,'',gjmc,xh) xh,kgrq,GJMC,GJSD,gjxh,gjcd from ( select decode(xh1,'',xh,xh1) as xh,kgrq,GJMC,GJSD,gjxh,gjcd from ( select (case w 阅读全文
posted @ 2011-10-25 10:43 居后不争 阅读(6210) 评论(0) 推荐(0) 编辑
摘要: CREATE OR REPLACE Procedure SP_GETSUMMARY_SUCKERROD(well in varchar2,kgsj in varchar2,p_cursor out ego.cursorType)asbeginopen p_cursor forselect a.JH,a.KGRQ,replace(decode(a.XH,'',MC,a.XH),'HS','活塞')as xh,MC,b.SD,GG,CD,XJRQ,CJ,TYRQ,GHBS,CJDM,LX,SCCJ , GJ , KX , FZQSL , FZQLX 阅读全文
posted @ 2011-10-25 10:42 居后不争 阅读(12332) 评论(0) 推荐(0) 编辑
摘要: 原查询结果如下:要求实现如下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 '' en 阅读全文
posted @ 2011-10-25 10:40 居后不争 阅读(575) 评论(0) 推荐(0) 编辑