sql 同一个字段在查询结果中出现两次

时间:2022-08-01 20:10:49

SELECT

    GET .daytime,
    GET.data AS GET,
    xh.data AS xh
FROM
    ( SELECT daytime, SUM ( get_sum ) AS data FROM yuanbao_get GROUP BY daytime ORDER BY daytime ) AS GET,
    ( SELECT daytime, SUM ( xh_sum ) AS data FROM yuanbao_xh GROUP BY daytime ORDER BY daytime ) AS xh
WHERE
    GET.daytime = xh.daytime