加入多个sum sql语句

时间:2015-09-14 04:43:47

标签: sql oracle sum

如何加入多个sql语句。我需要分别在一个视图中显示2004,2008,2009等等

SELECT SUM(ACQUISITIONPRICE) AS YEAR_2007
FROM TRANS
WHERE DATEACQUIRED LIKE '%07';

SELECT SUM(ACQUISITIONPRICE) AS YEAR_2008
FROM TRANS
WHERE DATEACQUIRED LIKE '%08';

SELECT SUM(ACQUISITIONPRICE) AS YEAR_2009
FROM TRANS
WHERE DATEACQUIRED LIKE '%09';

0 个答案:

没有答案