篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sql 检查geraçãotarefassep e cont para sortimento相关的知识,希望对你有一定的参考价值。
select top 100 t.taskId, t.Description, t.CreateDate,
case when ( select count(*) from stra.AssortAuditOut where TaskId = t.TaskId and HasStock = 1 and IsScanned = 0) > 0
then 'Deveria gerar Separação'
else
case when ( select count(*) from stra.AssortAuditOut where TaskId = t.TaskId and HasStock = 0 and IsScanned = 1) > 0
then 'Deveria gerar contagem'
else 'Não deveria gerar nenhum'
end end, tt.TaskId, tt.Description, ttt.TaskId, ttt.Description, tttt.TaskId, tttt.Description
from tm.task t
left join tm.task tt on tt.OriginalTaskId = t.TaskId
left join tm.task ttt on ttt.OriginalTaskId = tt.TaskId
left join tm.task tttt on tttt.OriginalTaskId = ttt.TaskId
where t.CreateDate >= cast(getdate() As Date)
and t.ActionId = 20
order by t.createdate desc
以上是关于sql 检查geraçãotarefassep e cont para sortimento的主要内容,如果未能解决你的问题,请参考以下文章