-
-
金12 数据小白Lv1
发表于2022-7-20 14:21
悬赏1
未解决
楼主
<#=ardb("select code from (select a.*, rownum rowsn from (select substr(code, 1, 3) code, sum(money / 10000) money from xxx where substr(date,1,6) <= '"+@rq+"' and year = '"+left(@rq,4)+"' and DE_CODE in(@a.value.split('\|')) and if(@b='""','"1=1"','"("' + ([] + @b.value).select(true,if(@.level=0, ""AG_CODE like '" + left(@,3) + "%'"", if(@.level=1, ""AG_CODE like '" + left(@,6) + "%'"", ""AG_CODE='" + @ + "'""))).join("" or "") + '")"') group by substr(code, 1, 3) order by sum(money) desc) a) where rowsn = 1")#>