0
How do I return instead Null
return as Não
. I’m having second thoughts about using the ISNULL
within the Subselect
along with the case.
Upshot:
Projeto teste Null
Projeto OK Sim.
Instead of Null
I want you to call me back NÃO
, how do I do?
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
This I know how to use, because it is a simple select, but I’m having difficulties in the cited query, because it is a subselect.
– Renan Bessa
I find it amusing that my answer is negative, since I answered the question that had been asked. After my answer was edited the question for what really he needed!
– karanalpe