M
modhorat
Guest
I'm new to SQL, I've been using SQL on a Progress Database (I'm sure it uses SQL92)
Current Output:
Required Output:
Progress (or at least mine does not support PIVOT)
I have the following code below:
Select Account,
SUM(CASE WHEN AccMonth = '201703' THEN Amount END) AS "201703",
SUM(CASE WHEN AccMonth = '201702' THEN Amount END) AS "201702",
SUM(CASE WHEN AccMonth = '201701' THEN Amount END) AS "201701"
FROM
(
Select pub."GL_Table"."AccNum_Col" AS "Account", pub."GL_Table"."AccMnth_Col" AS "AccMonth", Sum(pub."GL_Table"."Amount_Col") AS "Amount"
FROM pub."GL_Table"
GROUP BY pub."GL_Table"."AccNum_Col", pub."GL_Table"."AccMnth_Col"
) AS tempTB
GROUP BY Account
Continue reading...
Current Output:
Required Output:
Progress (or at least mine does not support PIVOT)
I have the following code below:
Select Account,
SUM(CASE WHEN AccMonth = '201703' THEN Amount END) AS "201703",
SUM(CASE WHEN AccMonth = '201702' THEN Amount END) AS "201702",
SUM(CASE WHEN AccMonth = '201701' THEN Amount END) AS "201701"
FROM
(
Select pub."GL_Table"."AccNum_Col" AS "Account", pub."GL_Table"."AccMnth_Col" AS "AccMonth", Sum(pub."GL_Table"."Amount_Col") AS "Amount"
FROM pub."GL_Table"
GROUP BY pub."GL_Table"."AccNum_Col", pub."GL_Table"."AccMnth_Col"
) AS tempTB
GROUP BY Account
Continue reading...