mysql - SQL query in Doctrine2 -


i need here, know how transform sql query doctrine2 query using createquerybuilder?

select a.resposta,
(
select count(r.id)
car_resultado r2
left join car_resultado_inquerito ri2 on r2.id_resultado_inquerito = ri2.id
ri2.id_inquerito = 20 , r2.id_resposta = a.id
group r2.id_pergunta, r2.id_resposta
) total
car_resposta a
left join car_resultado r on ( r.id_resposta = a.id )
group a.id, r.id_resposta

i have no idea how it, because nested select

normally have create entities , repositories data database. in doctrine2 uncool way. can execute native sql.

doctrine2 native sql

if possible shouldn't , work classes if have complicated existing queries can it.


Comments

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c# - Copy ObservableCollection to another ObservableCollection -

All overlapping substrings matching a java regex -