23 lines
632 B
Transact-SQL
23 lines
632 B
Transact-SQL
|
|
CREATE VIEW [dbo].[View_NoCheckWelder]
|
|
as
|
|
select
|
|
distinct(welder.WED_ID),
|
|
joint.ProjectId,
|
|
welder.WED_Unit,
|
|
welder.WED_Code,
|
|
welder.WED_Name,
|
|
Unit.UnitName,
|
|
joint.ISO_ID
|
|
from PW_JointInfo as joint
|
|
left join BS_Welder as welder on welder.WED_ID = joint.JOT_CellWelder
|
|
LEFT JOIN Base_Unit AS Unit ON Welder.WED_Unit = Unit.UnitId
|
|
where welder.WED_IfOnGuard='1'
|
|
and (welder.WederType='1' or welder.WederType is null)
|
|
and (welder.WED_ID in(select JOT_CellWelder from PW_JointInfo where DReportID is not null))
|
|
and (welder.WED_ID not in(select JOT_CellWelder from PW_JointInfo where JOT_ID in (select JOT_ID from CH_CheckItem)))
|
|
|
|
GO
|
|
|
|
|