Select Count(id_cand), count(b.Carg) As Carg, Count(Vags), id_cand / Carg
From Insc as a
inner join Carg as b
on a.CodigoCarg = b.CodigoCarg
Group by a.id_cand, b.Carg, vags
1 Resposta
/*sem teste todavia */
Select Count(CodigoCandidato) As Numero_de_inscritos,
count(b.DescricaoCargo) As Cargo,
Count(Vagas),
(CASE WHEN Count(Vagas) <> 0
THEN (Count(CodigoCandidato)/Count(Vagas))
ELSE NULL END) As Demanda_candidatos_por_vagas
From Inscricao as a
inner join Cargo as b
on a.CodigoCargo = b.CodigoCargo
group by
?