I want to transform SQL to Eloquent from Laravel?

0
SELECT temp.total, 
       p.stc_sexo as sexo, 
       count(pos.coi_posdoutorando) as numPosDout, 
       round(((count( pos.coi_posdoutorando)/temp.total)*100),2) as media    
FROM 
  (
    select count(*) as total, 
           0 as sexo,
           0 as numPosDout,
           0 as media from posdoutorandos where stc_status = 'A'
  ) as temp, posdoutorandos pos, sgp.pessoas p 
WHERE p.coi_pessoa = pos.coi_pessoa 
and pos.stc_status = 'A' 
group by p.stc_sexo
    
asked by anonymous 13.06.2018 / 15:32

0 answers