码迷,mamicode.com
首页 > 数据库 > 详细

把查询出来的sql作为一张表做第二次查询

时间:2017-10-14 17:12:10      阅读:335      评论:0      收藏:0      [点我收藏+]

标签:查询   col   string   sch   birt   payment   ide   row   dex   

String evTable = "select * from erp_visit erv " +
        "where erv.DISCHARGE_DATE_TIME is null and erv.patient_id=?1 and rownum=1 " +
        "order by erv.ACCEPT_DATE_TIME desc";
String sql = "select pmi.patient_id,ev.visit_no,pmi.name,pmi.sex,pmi.date_of_birth,pmi.next_of_kin,pmi.next_of_kin_phone," +
        "ev.dise_level_code,ev.discipline_code,ev.green_channel,ev.arrival_date_time," +
        "ov.identity,ov.charge_type,ov.visit_dept_code," +
        "pa.outp_prepayments " +
        "from pat_master_index pmi,outp_visit ov,(" + evTable + ") ev,prepayment_account pa " +
        "where ev.patient_id=pmi.patient_id " +
        "and ev.visit_no=ov.visit_no " +
        "and pmi.patient_id=pa.patient_id";

 

把查询出来的sql作为一张表做第二次查询

标签:查询   col   string   sch   birt   payment   ide   row   dex   

原文地址:http://www.cnblogs.com/ms-grf/p/7667483.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!