[stackoverflow] [progress Openedge Abl] Sql (in Progress Database) - How To Pivot...

Status
Not open for further replies.
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...
 
Status
Not open for further replies.
Top