0

我在表演一个小组时苦苦挣扎了一段时间。在查看所有示例后,由于某种原因,我仍然无法执行正确的分组。我的表是这样创建的:

CREATE TABLE IF NOT EXISTS itvance.identityuserdata ( 
id TEXT, 
type TEXT, 
tenantId TEXT, 
version INT, 
data JSONB, 
PRIMARY KEY((id, type, tenantId), version)) 
WITH transactions ={'enabled': true }

在此处输入图像描述

4

1 回答 1

0

Please use below query,

select id, type, tenantid, version
from identityuserdata group by id, type, tenantid, version;

But, since you are not aggregating any thing, you not need to use Group By. You can just use Distinct clause

select distinct id, type, tenantid, version
from identityuserdata group by id, type, tenantid, version;
于 2020-05-27T13:06:01.397 回答