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