sql Análiserevertradosvs tarefas SaaS

Posted

tags:

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


--Total de Items Integrados via Ficheiro
select count(distinct itemid) as "Total de Items Integrados via Ficheiro" from intf.st_in_gama with(nolock) where ctrl_data > getdate() - 1 and retailstoreid = '8';

--Total de Items Elegíveis (alteração nome/descrição ou preço)
select count(distinct itemid) as "Total de Items Elegíveis (alteração nome/descrição ou preço)" from ra.itemretailstore with(nolock) where lastpricechange > getdate() - 1 and retailstoreid = 'S0008';

--total de items com alerta configurado
select count(distinct i.itemid) as "Total de Items Ativos e com Alerta Configurado" 
from ra.item i with(nolock)
	join ra.itemretailstore irs with(nolock) on irs.itemid = i.itemid
where irs.retailstoreid = 'S0008' and irs.status in ('A','D') and irs.lastpricechange > getdate() - 1 and hierarchicalstructureid in (
		SELECT DISTINCT hsp.HierarchicalStructureId
		FROM ra.HierarchicalStructurePath hsp with(nolock)
			INNER JOIN ra.BusinessStructureItem bsi with(nolock) ON bsi.HierarchicalStructureId = hsp.HierarchicalAncestorId
		WHERE bsi.BusinessStructureListId in (
			select a.businessstrucutureid from tm.alertconfig a with(nolock) 
				join tm.locationitem li with(nolock) on li.locationlistid = a.locationlistid 
			where li.retailstoreid = 'S0008' and a.status in ('A','W')
		)
	);

-- total de items sem alerta configurado
select count(distinct itemid) as "Total de Items sem Alerta Configurado"
from ra.item with(nolock) 
where itemid in (select itemid from ra.itemretailstore with(nolock) where lastpricechange > getdate() - 1 and retailstoreid='S0008') 
	and hierarchicalstructureid not in (
	SELECT DISTINCT hsp.HierarchicalStructureId
	FROM ra.HierarchicalStructurePath hsp with(nolock)
		INNER JOIN ra.BusinessStructureItem bsi with(nolock) ON bsi.HierarchicalStructureId = hsp.HierarchicalAncestorId
		WHERE bsi.BusinessStructureListId in (
			select a.businessstrucutureid from tm.alertconfig a with(nolock) 
			join tm.locationitem li with(nolock) on li.locationlistid = a.locationlistid 
			where li.retailstoreid = 'S0008' and a.[status] IN ('A','W')
		)
	);

-- total de items na tarefa
select count(distinct itemid) as "Total de Items nas Tarefas" 
from tm.taskitem with(nolock) 
where taskid in(select TaskId from tm.Task with(nolock) where TaskId >= (select MIN(taskid) from tm.Task where ActionId = 14 and createdate > GETDATE()-1) and actionid = 14 and retailstoreid = 'S0008')

以上是关于sql Análiserevertradosvs tarefas SaaS的主要内容,如果未能解决你的问题,请参考以下文章

sql 卸妆zonasduplicadasInventários

sql CálculosGPS

sql Criando umnovousuário来自sql no Magento

sql Verificasehá锁定没有BD(postgres)

sql Lista todososusuáriosemum banco de dados postgres。

sql Desactivar / eliminar(para bajas)elcatálogodeUna farmacia