How to sum amount with columns that have complicated structures, such as decode?
This could be an easy question for many of you. I need to sum up some amount columns in my SQL statement. However, I also have some columns with complicated structures which caused problem when I put them in grouping section. Here are two types of examples:
1. DECODE(PLL.PO_RELEASE_ID, NULL, NVL(POH.AUTHORIZATION_STATUS, 'INCOMPLETE'), NVL (POR.AUTHORIZATION_STATUS,'INCOMPLETE')) STATUS
2. CC.SEGMENT1||'-'||CC.SEGMENT2||'-'||CC.SEGMENT3||'-'||CC.SEGMENT4||'-'||CC.SEGMENT5||'-'||CC.SEGMENT6 ACCOUNTING
When I put them in grouping section without name part, SQL finish normal but there is no row returned. I supposed to have thousands and thousands rows back. Not sure how to get around of this.