简体   繁体   English

如何将此语句从MySQL转换为HQL?

[英]How to convert this statement from MySQL to HQL?

This is the SQL statement: 这是SQL语句:

SELECT opc.contenido, COUNT(r.idOpcPregunta)  
from  Opcionesrespuestas as opc LEFT JOIN Respuestasimples as r ON r.idOpcPregunta = opc.idOpcPregunta 
where opc.idPregunta ='6' 
GROUP BY opc.idOpcPregunta;

This is a HQL 这是一个HQL

select opc.contenido, count(r.idOpcPregunta)  
from  Opcionesrespuestas as opc 
left join opc.OpcPregunta as r  
where opc.idPregunta ='6' 
group by opc.contenido;

This is the sentence HQL 这是句子HQL

select opc.contenido, count(r.idOpcPregunta)   from  Respuestasimples as r
right join r.idOpcPregunta as opc  where opc.idPregunta ='6'  
group by opc.contenido

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM