想要啥形式合并,直接union all?
Select c.名称,b.名称 As 科室,a.姓名,a.登记时间,数次 As 数量,实收金额 as 金额 From 住院费用记录 a,部门表 b,药品目录 c
Where
union all
Select c.名称,b.名称 As 科室,a.姓名,a.登记时间,数次 As 数量,实收金额 as 金额 From 门诊费用记录 a,部门表 b,药品目录 c
Where
Select c.名称,b.名称 As 科室,a.姓名,a.登记时间,数次 As 数量,实收金额 as 金额 From 住院费用记录 a,部门表 b,药品目录 c
Where
union all
Select c.名称,b.名称 As 科室,a.姓名,a.登记时间,数次 As 数量,实收金额 as 金额 From 门诊费用记录 a,部门表 b,药品目录 c
Where
Select c.名称,b.名称 As 科室,a.姓名,a.登记时间,数次 As 数量,实收金额 as 金额
From (
select 姓名,登记时间, 数量,实收金额,…… from 住院费用记录
union all
select 姓名,登记时间, 数量,实收金额,…… from 门诊费用记录
) a,部门表 b,药品目录 c
Where ……
(
select 姓名,登记时间, 数量,实收金额,…… from 住院费用记录
union all
select 姓名,登记时间, 数量,实收金额,…… from 门诊费用记录
) a
照这个直接写,改他干啥?