@Diegosoares You can use the following query:
1- Return total records
select Especialidade = Count(distinct speciality)
from employees
2- grouped by type of expertise
select Qtd = Count(distinct specialty) specialty
from employees
Group by specialty
3- filtered by speciality
select Qtd = Count(distinct specialty)
Where especialidade = "filter to place"
from employees
4- filtered and grouped
select Qtd = Count(distinct specialty)
Where speciality = "filter 1 to place"
from employees
Union all
select Qtd = Count(distinct specialty)
Where speciality = "filter 2 to place"
from employees
5- various specialties
select Qtd = Count(distinct specialty)
Where especialidade in ("filter to be put", "filter 2")
from employees
It worked! And how do I rename the column from there?
– Diego Soares
I changed the answer, see
– Rovann Linhalis
@Diegosoares, remember to mark the answer as correct, if solved the problem ;)
– rLinhares