SQL Language (MOSC)

MOSC Banner

How to sum amount with columns that have complicated structures, such as decode?

edited May 9, 2011 3:40AM in SQL Language (MOSC) 4 commentsAnswered
Hi everyone,

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.

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center