来来来,给这个 sql 来个优化方案

查看 68|回复 2
作者:aw2350   
SELECT
kdojhad,
k3jyqb4,
(
(
(
SELECT MAX
( calc_65b868adfd5b141878679de2 )
FROM
(
SELECT
( SUM ( t623be1f4fd5b1419766ff0b8."c2" ) ) AS calc_65b868adfd5b141878679de2,
t623be1f4fd5b1419766ff0b8."c10" AS dimension0
FROM
t623be1f4fd5b1419766ff0b8
WHERE
( ( t623be1f4fd5b1419766ff0b8."c11" = k3jyqb4 ) AND ( t623be1f4fd5b1419766ff0b8."c10" = kdojhad ) )
GROUP BY
dimension0
) AS res
)
)
) AS kxxz3vy
FROM
( SELECT t623be1f4fd5b1419766ff0b8."c11" AS k3jyqb4, t623be1f4fd5b1419766ff0b8."c10" AS kdojhad FROM t623be1f4fd5b1419766ff0b8 GROUP BY kdojhad, k3jyqb4 ) AS dataSource

kdojhad, select, k3jyqb4, C10

RiESA   
SELECT kdojhad,
k3jyqb4,
( (
(SELECT MAX ( calc_65b868adfd5b141878679de2 )
FROM
(SELECT ( SUM ( t623be1f4fd5b1419766ff0b8."c2" ) ) AS calc_65b868adfd5b141878679de2,
t623be1f4fd5b1419766ff0b8."c10" AS dimension0
FROM t623be1f4fd5b1419766ff0b8
WHERE ( ( t623be1f4fd5b1419766ff0b8."c11" = k3jyqb4 )
AND ( t623be1f4fd5b1419766ff0b8."c10" = kdojhad ) )
GROUP BY dimension0 ) AS res ) ) ) AS kxxz3vy
FROM
(SELECT t623be1f4fd5b1419766ff0b8."c11" AS k3jyqb4,
t623be1f4fd5b1419766ff0b8."c10" AS kdojhad
FROM t623be1f4fd5b1419766ff0b8
GROUP BY kdojhad, k3jyqb4 ) AS dataSource

帮你优化了一下格式,不用谢
aw2350
OP
  
@RiESA 谢谢 好人一生平安
您需要登录后才可以回帖 登录 | 立即注册

返回顶部