Hybris 计数(*)不显示空值

Hybris 计数(*)不显示空值,hybris,flexible-search,Hybris,Flexible Search,我正在使用SAP的Hybris进行一个小项目,几乎完成了。我正在尝试使用灵活搜索查找过去7天内订单为0的服务点位置的数量 以下是我使用的HAC脚本: select count(*), {PointOfService.name} from {Order left join PointOfService on {Order.pointOfService} = {PointOfService.pk}} where {creationTime} >= '2019-10-01' GROUP by {

我正在使用SAP的Hybris进行一个小项目,几乎完成了。我正在尝试使用灵活搜索查找过去7天内订单为0的服务点位置的数量

以下是我使用的HAC脚本:

select count(*), {PointOfService.name} from {Order left join PointOfService on {Order.pointOfService} = {PointOfService.pk}} where {creationTime} >= '2019-10-01' GROUP by {PointOfService.name} order by count(*)

脚本为我提供了每个服务点的订单数量,但没有为我提供订单为“0”的服务点位置。我了解到这是由于count(*)未提供空值。有人知道解决这个问题的方法吗?

您的where(creationTime)中有一个order属性,因此如果没有特定服务点的订单,您将无法看到它。 类似的方法应该会奏效:

select count(*),
{ps.name}
from {PointOfService as ps 
left join Order as o on {o.pointOfService} = {ps.pk}}
where count({o.pk}) == 0
GROUP by {ps.name}