日期:2014-05-16 浏览次数:20718 次
SELECT
*
FROM
(SELECT
salesName, SUM(extendedPrice) AS sumprice13
FROM
tableSales
WHERE
salesTime BETWEEN '2013-01-01' AND '2013-12-31'
GROUP BY
salesName) AS a
INNER JOIN (SELECT
salesName, SUM(extendedPrice) AS sumprice14
FROM
tableSales
WHERE
salesTime BETWEEN '2014-01-01' AND '2014-12-31'
GROUP BY
salesName) AS b ON a.salesName=b.salesName