这段psql语句是什么意思?求高手!
select yy_jhlbid,yy_jhsj,shsj,hfsj,yy_khmc,yy_dhhm,yy_khdz,yy_jhztbz,yy_jhflmc,yy_jhzlmc,yy_sxnr,yy_bmmc,yy_clbz
from (select yy_jhlb.yy_sametel,yy_jhlb.yy_flag9,yy_jhlb.yy_jhlbid,yy_jhlb.yy_jlsj yy_jhsj,yy_jhlb.yy_jlsj,yy_shsj.shsj,yy_hfsj.hfsj,yy_jhlb.yy_khmc,
yy_jhlb.yy_dhhm,yy_jhlb.yy_khdz,yyv_jhfl.yy_jhflmc,yyv_jhzl.yy_jhzlmc,yy_jhlb.yy_sxnr,yy_jhlb.yy_zbbmbh,yyv_bm.yy_bmmc,yy_jhlb.yy_clbz, yy_jhlb.yy_sfzb,
decode(yy_jhlb.yy_jhztbz,'0','未受理','1','已受理','2','处理完毕','3','处理中','7','发货列表转发','8','发货转发','9','货物退回')
yy_jhztbz, round((nvl(shsj, sysdate) - nvl(nvl(fhsj,yy_jlsj), sysdate)) * 24, 0) shsjc,
round((nvl(nvl(yy_completedtime, hfsj), sysdate) -nvl(shsj, sysdate)) * 24,0) hfsjc,
decode(yy_zyjb, '1', 24, '2', 48, '3', 72, 24) ckz from yy_jhlb, yyv_bm,yyv_jhfl,yyv_jhzl, (select yy_jhlbid, max(yy_hfsj) fhsj from yy_jhlb_cl
where yy_clbz = '7'
group by yy_jhlbid) yy_fhsj, (select yy_jhlbid, min(yy_hfsj) shsj
from yy_jhlb_cl where yy_clbz = '1' group by yy_jhlbid) yy_shsj, (select yy_jhlbid, max(yy_hfsj) hfsj
from yy_jhlb_cl where yy_clbz = '2' group by yy_jhlbid) yy_hfsj, (select yy_telid, yy_completedtime from yy_tel_repairinfo, yy_jhlb
where yy_tel_repairinfo.yy_telid(+) = yy_jhlb.yy_jhlbid and trunc(yy_jlsj) between to_date('2012-05-01','yyyy-mm-dd')
and to_date('2012-05-25','yyyy-mm-dd') ) yy_xfsj where yy_jhlb.yy_jhztbz in ('1', '2', '3')
and yy_jhlb.yy_jhflbh in ('03', '16', '28', '18', '46') and yy_jhlb.yy_jhlbid = yy_fhsj.yy_jhlbid(+)
and yy_jhlb.yy_jhlbid = yy_shsj.yy_jhlbid(+) and YY_JLLXBH = '0' and yy_jhlb.yy_jhlbid = yy_hfsj.yy_jhlbid(+)
and yy_jhlb.yy_jhflbh = yyv_jhfl.yy_jhflbh and yy_jhlb.yy_jhzlbh = yyv_jhzl.yy_jhzlbh and yy_xfsj.yy_telid(+) = yy_jhlb.yy_jhlbid
and yy_bmbh = yy_zbbmbh ) yy_cstj where (hfsjc > ckz and yy_flag9 <> 1 and yy_sametel = 0) and yy_sfzb = 1 and yy_zbbmbh in ('01', '02', '03', '04')
and trunc(yy_jlsj) between to_date('2012-05-01','yyyy-mm-dd') and to_date('2012-05-25','yyyy-mm-dd') and yy_zbbmbh like '%%'
希望能详细解答!我是菜鸟~
------解决方案--------------------这种问题的答案在这段代码的名字、参数、返回值、以及调用文档中。
代码本身只对写代码的人自己除错有用。
你应该学会自顶而下看代码的习惯。
------解决方案--------------------oracle中的psql就好像SQL Server中的T-SQL
------解决方案--------------------
yy_jhlb, yyv_bm,yyv_jhfl,yyv_jhzl 这几个表你知道内容吧,无非就是从这几个表里查一些满足条件的数据,你从from关键字开始读,看看where里有什么限制,最后看看查询了那些数据。