跳至主要內容

条件案例:筛选条件数据

五六零网校小于 1 分钟

示例代码

DECLARE @ItemCode nvarchar(20)
DECLARE @TMP int
SELECT @TMP=COUNT(*)
FROM(
SELECT DISTINCT T0.[Father] FROM ITT1 T0 
WHERE T0.father NOT IN (
			SELECT code
			FROM ITT1 WHERE code is not null
		)
)T0 WHERE T0.father='[%0]' ;
SET @ItemCode='[%0]';