IF EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID('[dbo].[privateview_8]') AND type = 'V')
DROP VIEW [dbo].[privateview_8]
GO
CREATE VIEW [dbo].[privateview_8]
AS
select 
ot_title [岗位名称],dt_dpid ,dt_id [部岗ID],
isnull(acc_value,0)/100 [预编人数],
isnull(acc_used,0)/100 [在编人数],
ot_id objid
from 
mps_title with(nolock),
mps_depart_title with(nolock),
mps_account with(nolock)
where ot_id = dt_otid and dt_id = acc_objid