Every derived table must have its own alias

派生出来的表必须取别名

SELECT
    sum( a.exposureMarketcapDiff ) 
FROM
    (
SELECT
    new.id,
    new.coinId,
    ifnull( new.exposureMarketcap, 0 ) - ifnull( old.exposureMarketcap, 0 ) AS exposureMarketcapDiff 
FROM
    ( SELECT id, coin_id AS coinId, exposure_marketcap AS exposureMarketcap FROM reconcile_marketcap WHERE period_number = ( 3 ) ) new
    LEFT JOIN ( SELECT id, coin_id AS coinId, exposure_marketcap AS exposureMarketcap FROM reconcile_marketcap WHERE period_number = ( 3-1 ) ) old ON new.coinId = old.coinId 
    ) a

上一篇:C#中使用Spire实现PDF转图片


下一篇:Spire.Cloud 在线协同编辑Word文档