子查询应用:把子查询作为某个字段

select ddmx.xm_id, ddmx.tdzt, ddmx.dd_id, to_char(ddmx.qsrq, 'yyyy-MM-dd HH24:mi:ss') qsrq, ddmx.ddh, ddmx.ydh, (select d.dmmc from tb_wl_dm_gndm d where ddmx.sfd_id = d.dmdm) sfdmc, (select m.dmmc from tb_wl_dm_gndm m where ddmx.mdd_id = m.dmdm) mddmc, ddmx.shr, ddmx.sjjs, ddmx.sjtj, ddmx.sjzl, ddmx.qsr from tb_wl_sc_ddmx ddmx where 1 = 1 and ddmx.xm_id = '0000000004' and ddmx.fyrq >= to_date('2009-04-14', 'yyyy-mm-dd') and ddmx.yjddrq <= to_date('2009-05-14', 'yyyy-mm-dd')

你可能感兴趣的:(Date)