簡體   English   中英

如何將此語句從MySQL轉換為HQL?

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

這是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;

這是一個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;

這是句子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