SELECT * FROM (select aa.*,bb.mentalvisitid, ' then '家庭访视' else '电话' end as BCSFXS ,bb.visitdate, ' then '曾住院,现未住院' else '未住院' end as Hospitalstatus, ' then '基本稳定' else '稳定' end as visittype , ' then '不用药' else '医嘱无需用药' end as Followmedicine, ' then…