create or replace view v_name
as
select t1.ID, t1.NAME, t2.KSTIME, t2.JSTIME, t2.LX
from
(
select * from B1
union all
select * from B2
union all
select * from B3
) t1,
(
select * from S1
union all
select * from S2
union all
select * from S3
) t2
where t1.ID=t2.MID
或者
CREATE OR REPLACE VIEW VIEW_a AS
SELECT
s.a1 as a2,
sw.a3 as XM ,
(select s.dict_value1
from a4 s
where s.a5='XBDM' and s.dict_key=sw.a6)
as XB ,
sw.a7 as NL ,
sw.a8 as DWZZ
FROM a9 sw,a10 s
WHERE s.id=sw.a11 and s.save_flag=1 and s.finish_flag=1 and s.qualified_flag=1 and s.delete_flag=0
WITH READ ONLY