sql Validar Buns Repetidas

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sql Validar Buns Repetidas相关的知识,希望对你有一定的参考价值。


DECLARE @Aux int = 0
DECLARE @Conta int = 0

WHILE @Aux < 100
BEGIN
	SELECT @Conta = COUNT(1) FROM ra.HierarchicalStructure WHERE HierarchicalStructureId LIKE '%.' + CONVERT(varchar, @Aux) AND HierarchyLevel = 'BUN'
	
	IF (@Conta > 1)
	BEGIN
		print @Aux
	END

	SET @Aux = @Aux + 1
END


--DECLARE @HierarchicalStructureId varchar(18) = '21.32'
--SELECT COUNT(1) AS Estruturas_Ativas FROM ra.HierarchicalStructure WITH(NOLOCK) WHERE HierarchicalStructureId LIKE @HierarchicalStructureId + '%' AND Status != 'I'
--SELECT COUNT(1) AS Artigos FROM ra.Item WITH(NOLOCK) WHERE HierarchicalStructureId IN (SELECT HierarchicalStructureId FROM ra.HierarchicalStructure WITH(NOLOCK) WHERE HierarchicalStructureId LIKE @HierarchicalStructureId + '%' AND HierarchyLevel = 'UNB' AND Status = 'I')
--SELECT COUNT(1) AS Validades FROM vd.NumDaysValidaty WITH(NOLOCK) WHERE HierarchicalStructureId IN (SELECT HierarchicalStructureId FROM ra.HierarchicalStructure WITH(NOLOCK) WHERE HierarchicalStructureId LIKE @HierarchicalStructureId + '%' AND HierarchyLevel = 'UNB' AND Status = 'I')

----DELETE vd.NumDaysValidaty WHERE HierarchicalStructureId IN (SELECT HierarchicalStructureId FROM ra.HierarchicalStructure WITH(NOLOCK) WHERE HierarchicalStructureId LIKE @HierarchicalStructureId + '%' AND HierarchyLevel = 'UNB' AND Status = 'I')
----DELETE ra.HierarchicalStructure WHERE HierarchicalStructureId LIKE @HierarchicalStructureId + '%' AND Status = 'I'






--DECLARE @Aux int = 32

--SELECT * FROM ra.HierarchicalStructure WHERE HierarchicalStructureId LIKE '%.' + CONVERT(varchar, @Aux) AND HierarchyLevel = 'BUN'

以上是关于sql Validar Buns Repetidas的主要内容,如果未能解决你的问题,请参考以下文章

文化 | 二十九 蒸馒头 Steam Buns

CodeForces 106C. Buns

javascript Validar plataforma web

python Validar DNI,NIF,NIE

PHP Php validar电子邮件

PHP Validar电子邮件php5