用户86495912(提问者)比如select ROW_NUMBER()over(order by sum(bf.finalDiscountFee) desc) as \'排名\' , bm.mainquotationuserName as \'客户经理\',sum(bf.finalDiscountFee) as \'销售额\'
from biz_main bm inner join biz_fee bf on bm.bizid = bf.bizid and bm.flag =1
where bm.bizStatus = 10030 and bm.ProStartDate between \'2020-03-01\' and \'2020-03-31\'
group by bm.mainquotationuserName
order by sum(bf.finalDiscountFee) desc 这个我一直在用的,反正只要有group by就会报错
用户86495912(提问者)不行吧,我没说清楚,在设计的时候不会报错,能执行且看到设计的效果柱状图,只有在点预览仪表盘的或发布公共链接打开的时候会出错,完整出错信息为:
java.util.concurrent.ExecutionException: com.finebi.conf.exception.execute.FineWidgetNoDataException: 错误代码:62400001The SQL : { select
T_F47D92.[客户经理] [PA_0],
sum(T_F47D92.[销售额]) [PA_1]
from (select ROW_NUMBER()over(order by sum(bf.finalDiscountFee) desc) as \'排名\' , bm.mainquotationuserName as \'客户经理\',sum(bf.finalDiscountFee) as \'销售额\'
from biz_main bm inner join biz_fee bf on bm.bizid = bf.bizid and bm.flag =1
where bm.bizStatus = 10030 and bm.ProStartDate between \'2020-03-01\' and \'2020-03-31\'
group by bm.mainquotationuserName
order by sum(bf.finalDiscountFee) desc
) [T_F47D92]
group by T_F47D92.[客户经理] } is wrong, please check!除非另外还指定了 TOP 或 FOR XML,否则,ORDER BY 子句在视图、内联函数、派生表、子查询和公用表表达式中无效。