0
I need to count table fields, however, these fields have different types of filters within Where. I need to be shown the consolidated information, I tried to do openquery but returns error.
select ct.contratante,
ct.fase,
(select count(distinct cpf) from #info_acionamentos xx with(nolock) where ct.status_alo = 1) as alo,
(select count(distinct cpf) from #info_acionamentos xx with(nolock) where ct.status_cpc = 1) as cpc
from #info_acionamentos ct
Makes a Union of the two selects that Voce commented, is the simplest way to do
– Germano Buss Niehues
How NOT to Ask Questions Manual - Post Code as Image
– Sorack
Table fields would be the legs of the table, the chair? You didn’t put example of what you have on your tables and what you want the result.
– Sorack
What do you want to do? Count table fields? Fields have filters. It would be better to present your question better
– Alberto Cláudio Mandlate