1
Guys, how do I put a case when exists within the query below. The result is currently coming out like this:
Customers Drugstore, Soccer, Gelagua
However, I want to put a case when exists if it is in condition, come yes, or no. Example:
Drugstore - Yes, Soccer - Yes, Gelagua - No
select
(REPLACE(REPLACE(REPLACE((STUFF((
SELECT
':::::: ' + CAST(U.USUNOME AS VARCHAR) + '
' FROM Usuario U LEFT JOIN FRM_51 F51C ON U.UsuID = F51C.ContaID LEFT JOIN FRM_52 F52P ON F52P.C01 = F51C.C01 LEFT JOIN Tarefa T ON T.TarID = F52P.TarefaID WHERE F51C.C04 = 3640 AND F51C.C01 = FRM52.C01 FOR XML PATH('')),1,1,1)),'1::::: ',''),':::::: ',''),' &# x0D;
','')) as Clientes
from
usuario
Should the information be horizontal even? Couldn’t it be vertical? Drugstore YES Soccer YES ...
– Carlos T. Gomes
in the same horizontal
– Renan Bessa