查找擔保圈-step7-提取未被包含過組的成員,得出結論

 1 USE [test]
 2 GO
 3 /****** Object:  StoredProcedure [dbo].[p05_get_group_member_cleared]    Script Date: 2019/7/8 15:32:01 ******/
 4 SET ANSI_NULLS ON
 5 GO
 6 SET QUOTED_IDENTIFIER ON
 7 GO
 8 ALTER PROC [dbo].[p05_get_group_member_cleared]
 9 AS
10 --s5,提取未被包含過組的成員,得出結論
11 BEGIN
12     IF OBJECT_ID(N'dbo.t05_get_group_member_cleared') IS NOT NULL
13         DROP TABLE dbo.t05_get_group_member_cleared;
14 
15     SELECT groupno AS 組編號,
16            id AS 組內編號,
17            cust_name,
18            nlevel AS 成員數
19     INTO dbo.t05_get_group_member_cleared
20     FROM [dbo].t02_get_group_member AS a
21     WHERE [groupno] IN (
22                            SELECT iinclude_groupno FROM dbo.t04_get_groupno_cleared
23                        );
24 END;
相關文章
相關標籤/搜索