How do I instead return Null
return as Não
. I'm in doubt about using ISNULL
within Subselect
along with the case.
Result:
Projeto teste Null
Projeto OK Sim.
Instead of Null
want to return NÃO
, how do I?
SELECT DISTINCT concat(CC.Descricao,'-',U1.UsuNome),
C.CompDesc QtdeCNPJs,
(SELECT top 1 Faturado = CASE T1.TarEstagioID
WHEN 112 THEN 'SIM'
ELSE 'NÃO'
END
FROM Projetos P
INNER JOIN Tarefa T1 ON P.ProjID = T1.ProjID
WHERE T1.TarStatus = 9
AND T1.TarTitulo = 'Treinamento Realizado - Emitir Boleto Setup'
AND P.ProjID = PP.ProjID
AND T1.TarTipID = 674) Faturado
FROM PROJETOS PP
INNER JOIN Tarefa T ON PP.ProjID = T.ProjID
INNER JOIN Usuario U ON T.UsuIDResponsavel = U.UsuID
INNER JOIN Usuario U1 ON T.UsuIDCliente = U1.UsuID
LEFT JOIN Complemento C ON C.UsuID = T.UsuIDCliente
AND C.CompID = 1
LEFT JOIN CurvaABC CC ON (CC.CurvaID = U1.CurvaID)
WHERE CC.CurvaID = 1