-
18754176079 数据达人Lv4
发表于2021-7-1 10:58
3个回答
SQL语法不支持
错误信息示例如下:
SELECT sum(DISTINCT (a.AJJZ)),sum(DISTINCT (a.AJBH)) from DW_OLAP_DPFZ a
ERROR: AnalysisException: all DISTINCT aggregate functions need to have the same set of parameters as sum(DISTINCT (a.AJJZ));
deviating function: sum(DISTINCT (a.AJBH))
解决方法:
修改PetaBase 的属性,需要在 jdbc 连接参数中添加 APPX_COUNT_DISTINCT=true
-
18754176079 数据达人Lv4
果冻出场 发表于 2021-7-2 14:30
SQL语法不支持
错误信息示例如下:
SELECT sum(DISTINCT (a.AJJZ)),sum(DISTINCT (a.AJBH)) from DW_OLAP_D ...
这个用sql实现了
-
18754176079 数据达人Lv4
果冻出场 发表于 2021-7-2 14:30
SQL语法不支持
错误信息示例如下:
SELECT sum(DISTINCT (a.AJJZ)),sum(DISTINCT (a.AJBH)) from DW_OLAP_D ...
select sdate,bv_name,mvanom,q,st_name,tr_name,ia,p from all_transformerwinding_model_his t1
where exists (select 1 from (select st_name,sdate,tr_name,bv_name,mvanom,max(ia) as ia,max(p) as p from all_transformerwinding_model_his
where st_type_name='变电站' and bv_name='<#=@p3120#>' and sdate between '<#=@riqi#>' and '<#=@riqi2#>' and yearmonth>=substr('<#=@riqi#>',1,6) and yearmonth<=substr('<#=@riqi2#>',1,6)
group by st_name,sdate,tr_name,bv_name,mvanom) t2
where t2.ia=t1.ia and t2.p=t1.p and t2.st_name=t1.st_name and t2.sdate=t1.sdate and t1.tr_name=t2.tr_name and t1.bv_name=t2.bv_name and t1.mvanom=t2.mvanom)
实现代码但是有点稍微重复有没有大神在修复修复