数据仓库服务 GAUSSDB(DWS)-SSB查询测试:Q4.1

时间:2024-10-22 11:41:47

Q4.1

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
SELECT div(LO_ORDERDATE,10000) AS YEAR,
C_NATION,
SUM(LO_REVENUE - LO_SUPPLYCOST) AS profit
FROM lineorder_flat
WHERE
C_REGION = 'AMERICA'
AND S_REGION = 'AMERICA'
AND P_MFGR IN ('MFGR#1', 'MFGR#2')
GROUP BY YEAR, C_NATION
ORDER BY YEAR ASC, C_NATION ASC;
support.huaweicloud.com/pwp-910-dws/dws_13_00031.html