hibernate hql不支持的查詢

不支持的查詢

union

from後加子查詢

select 後加子查詢

 


 

left join用法

select c.categoryId, c.categoryName, count(distinct p.productId) from  ProductCategory c, Product p left join p.brand as b
 where p.productCategory = c and p.brand = b  and p.saleStatus=true
 and (p.titleMain like '%m%' or b.name like '%m%')
 group by p.productCategory order by count(distinct p.productId) desc

發佈了33 篇原創文章 · 獲贊 4 · 訪問量 15萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章