Select Count corforme um condição?

Delphi

30/08/2015

Pessoal como fazer esse select enquanto a quantidade de qualquer uma das colunas a soma seja igual a 30.

Código:
select f.matricula_aluno, al.numero,
count(case when f.presenca = 'F' then 1 end) as QtdFaltas

from FREQUENCIA F left join alunoturma al on f.codigo_turma = al.codigo_turma and 
                                         (al.matricula_aluno = f.matricula_aluno) 

  where f.escola             =1 
  and f.codigo_turma        =226 
  and  f.codigo_disciplina  =15 
  and  f.bimestre          ='1 SEMESTRE' 

 group by f.matricula_aluno, al.numero 
  order  by al.numero
Osmar

Osmar

Curtidas 0
POSTAR