把查询出来的sql作为一张表做第二次查询
Posted 发福大叔
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了把查询出来的sql作为一张表做第二次查询相关的知识,希望对你有一定的参考价值。
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作为一张表做第二次查询的主要内容,如果未能解决你的问题,请参考以下文章