不支持的查詢
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