2
Good morning,
I need a help from you, I have a query in my system is with a problem, it brings 4 results, only 1 of these 4 is coming with null value.
I will post my query below
SELECT Title, SUM(Count) AS Count
FROM (
SELECT
CASE WHEN EstadoId = EstadoIdAutor AND EstadoId = Meddoc1 AND EstadoId = Meddoc2 AND EstadoId = Meddoc3 THEN
'Sem deslocamento'
ELSE CASE WHEN EstadoId = EstadoIdAutor AND (EstadoId = Meddoc1 OR EstadoId = Meddoc2 OR EstadoId = Meddoc3) THEN
'Fora de domicílio do autor'
ELSE CASE WHEN EstadoId <> EstadoIdAutor OR (EstadoId = EstadoIdAutor AND (EstadoId <> Meddoc1 AND EstadoId <> Meddoc2 AND EstadoId <> Meddoc3)) THEN
'Mais de um deslocamento'
END
END
END AS Title,
COUNT(*) AS Count
FROM jud_Processos
WHERE Status = 1 AND Trancado = 1
GROUP BY EstadoId, EstadoIdAutor, Meddoc1, Meddoc2, Meddoc3
) Sub
GROUP BY Title
Could someone help me? Where are you NULL come as Other
Dude worked really thanks, I can’t qualify as correct now, but once I release I qualify!
– Leonardo Macedo