我有一个结构如下的JPA查询:
SELECT distinct item
FROM ...
WHERE ...
ORDER BY ...
我使用的是MySQL 8,由于我使用ORDER BY子句按商品属性、区域名称、国家名称和品牌名称进行排序,因此收到以下错误:
Expression #1 of ORDER BY clause is not in SELECT list, references column 'db.country4_.name' which is not in SELECT list; this is incompatible with DISTINCT
我