GL_INTERFACE ISSUE [message #399967] |
Fri, 24 April 2009 12:53 |
Krishna_dev
Messages: 32 Registered: May 2007
|
Member |
|
|
I am running the journal import and would like to summarize the journal imports being inserted into gl_interface. I am working with 5 segments. So if code combinations in the journal entries are the same they will then I would like get the sum of those journal entries and summarize it as one line.
Example
In staging table:
SEGMENT1||SEGMENT2||SEGMENT3||SEGMENT4||SEGMENT5||AMOUNT
0001 020 0000 000 000 100
0001 020 0000 000 000 100
0001 020 0000 000 000 100
0001 020 0000 000 000 100
0002 030 0000 000 000 100
As above the first 4 lines are the same, each with an amount = 100. I would like to select those lines to enter into gl_interface so that they are one line totalling 400 for the first 4 and a seperate line of 100 for the 5th line which is a different combination as below
Inserting into gl_interface table:
SEGMENT1||SEGMENT2||SEGMENT3||SEGMENT4||SEGMENT5||AMOUNT
0001 020 0000 000 000 400
0002 030 0000 000 000 100
Does anyone know the SQL statement to do this.
|
|
|
Re: GL_INTERFACE ISSUE [message #399986 is a reply to message #399967] |
Fri, 24 April 2009 16:21 |
Krishna_dev
Messages: 32 Registered: May 2007
|
Member |
|
|
so far this is the query I have come up with to pull this off. Can anyone validate this for me.
select segment1,segment2,segment3,segment4,segment5,sum(amount)
from table_t
GROUP BY segment1,segment2,segment3,segment4,segment5;
|
|
|