sql historic200percentdebug.sql

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sql historic200percentdebug.sql相关的知识,希望对你有一定的参考价值。

SELECT

            SUM(p_tmhh.holding_pct * (s_sach.percentage / 100)) AS percentage
            FROM
            portfolio_trademodelholdinghistory AS p_tmhh
            INNER JOIN security_datedim AS s_dd ON s_dd.id = p_tmhh.holding_date_id
            INNER JOIN security_securityassetclasshistory s_sach ON s_sach.month_id = s_dd.month_id
            AND s_sach.security_id = p_tmhh.security_id
            INNER JOIN security_securitybreakdowntype AS s_sbt ON s_sbt.id = s_sach.securitybreakdowntype_id
            INNER JOIN portfolio_investmentoffering AS p_io ON p_tmhh.trade_model_id = p_io.trade_model_id
            INNER JOIN portfolio_offeringproducttype AS p_opt ON p_opt.id = p_io.product_type_id
            INNER JOIN portfolio_offeringimplementationtype AS p_oit ON p_oit.id = p_io.implementation_type_id
            WHERE
            p_io.strategy_id = 1
            AND p_io.is_primary = 1
            AND s_sbt.CODE = "Web"
            AND s_dd.id = 8767

            AND p_io.is_active = 1

            ORDER BY
            s_dd.trade_date DESC
            LIMIT 1

--             AND s_sach.asset_class3_id = %d

以上是关于sql historic200percentdebug.sql的主要内容,如果未能解决你的问题,请参考以下文章

SQL Performance历史SQL监控(Historical SQL Monitoring ) 功能(12c)

SQL调优指南笔记16:Managing Historical Optimizer Statistics

SQL调优指南笔记16:Managing Historical Optimizer Statistics

需要一个高效的sql查询

145 - 历史流程实例的操作

152 - 删除历史任务实例和获取身份链接