sql创建试图 调用
时间:2021-07-01 10:21:17
帮助过:2人阅读
OR REPLACE VIEW V_SELECTGPSINFO
AS
select d.applyid,
(select id
from tb_sys_org
where orgname
=g.appointmentarea )
as orgid,
--部门编号
g.appointmentarea
as orgname,
-- 部门
d.gpscode ,
--gps编号
g.acceptanceby,
--安装人员
g.acceptancetime ,
--安装时间
(
select brand
from tb_lm_gpsdepot
where gpscode
=d.gpscode)
as brand ,
--品牌
d.gpstype
--设备类型 0无线 1有线
from tb_lm_gpsworkorderdetial d
left join tb_lm_gpsworkorder g
on g.id
=d.gpsworkorderid
;
调用:select * from V_SelectGpsinfo where applyid={0} and gpscode=‘{1}‘
sql创建试图 调用
标签: