473,395 Members | 2,468 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

GROUPING IS INCONSISTENT error message

2
Hi all,

I am receiving a 'GROUPING IS INCONSISTENT' error message on the following SQL code. Any ideas ?

================================================== =======

SELECT DISTINCT C.C_ACCT_CA_PRFX||
SUBSTR(DIGITS(A.I_ACCT_CA),3,8)||
SUBSTR(DIGITS(A.I_TNT),4,2) ACCOUNT_NUMBER,
B.A_PK_CIS_CR_BAL,
SUM(B.A_KCM_TRAN_AMT),
SUM(D.A_BC_ORIG),
SUM(D.A_VAT_CHRG_ORIG),
SUM(D.A_VAT_PRPD_CHG_OUT)

FROM PRGP.TS083_CUSTOMER A,
PRGP.TR045_BLFIN_COCON C,
PRGP.TS322_POW_KEY_ACT B,
PRGP.TS032_BILL_CHRG D

WHERE A.C_CO = C.C_CO
AND B.I_ACCT_CA = D.I_ACCT_CA
AND B.I_TNT = D.I_TNT
AND B.I_ACCT_CA = A.I_ACCT_CA
AND B.I_TNT = A.I_TNT
AND A.I_ACCT_CA = 00101141
AND A.I_TNT = 03
GROUP BY B.A_KCM_TRAN_AMT,
D.A_BC_ORIG,
D.A_VAT_CHRG_ORIG,
D.A_VAT_PRPD_CHG_OUT
May 17 '07 #1
3 12350
frozenmist
179 Expert 100+
Hi EVANSY,
As I see it, you need not group the columns used in the sum().
In that case how will you get the sum? But this is not an error, i think.

I think the problem is that you need to group all other columns that have been mentioned in the select not using aggregate function like sum.
eg: you haven't added the columns which are part of account_number in group by.

Try out these.

Hope you find the solution
Cheers
May 17 '07 #2
EVANSY
2
Thanks for the advice but still appear to be getting the problem using the new code below.

Any ideas ?

================================================== =======

SELECT DISTINCT C.C_ACCT_CA_PRFX||
SUBSTR(DIGITS(A.I_ACCT_CA),3,8)||
SUBSTR(DIGITS(A.I_TNT),4,2) ACCOUNT_NUMBER,
B.A_PK_CIS_CR_BAL TOTAL_BALANCE,
SUM(B.A_KCM_TRAN_AMT) TOTAL_KEYCHARGES,
SUM(D.A_BC_ORIG) TOTAL_CHARGES,
SUM(D.A_VAT_CHRG_ORIG) ORIGINAL_VAT,
SUM(D.A_VAT_PRPD_CHG_OUT) TOTAL_VAT

FROM PRGP.TS083_CUSTOMER A,
PRGP.TR045_BLFIN_COCON C,
PRGP.TS322_POW_KEY_ACT B,
PRGP.TS032_BILL_CHRG D

WHERE A.C_CO = C.C_CO
AND B.I_ACCT_CA = D.I_ACCT_CA
AND B.I_TNT = D.I_TNT
AND B.I_ACCT_CA = A.I_ACCT_CA
AND B.I_TNT = A.I_TNT
AND A.I_ACCT_CA = 00101141
AND A.I_TNT = 03
GROUP BY A.I_ACCT_CA,
A.I_TNT,
B.A_PK_CIS_CR_BAL

================================================== =======
May 18 '07 #3
frozenmist
179 Expert 100+
Hi Evansy,
You also have to have
C.C_ACCT_CA_PRFX
in the group by clause.

Try this also
Cheers
May 18 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Matt | last post by:
I'm new to Java but experienced with PL/SQL. I've found what appears to be strange behaviour (a bug?) when attempting to create java stored objects using the UNIX version of Oracle SQL*PLUS...
2
by: PC Datasheet | last post by:
Does anyone have a technique for grouping in a form like grouping in a report and still be able to enter data in the form? Thanks for all responses, Steve PC Datasheet
3
by: ahaque38 | last post by:
Hello. Using A2K SP3, I am having the following problem with a report using "Sorting and Grouping". I have recently added a grouping in the reports for "Category2<>'CONTRACTS'". I have...
8
by: Mike MacSween | last post by:
tblCourses one to many to tblEvents. A course may have an intro workshop (a type of event), a mid course workshop, a final exam. Or any combination. Or something different in the future. At...
0
by: jlea | last post by:
I'm getting the following link error in my C++/.NET C++ project: error LNK2022: metadata operation failed (8013118D) : Inconsistent layout information in duplicated types (tagTOOLINFOA):...
1
by: Peter Steele | last post by:
I've created an unmanaged C++ DLL and when I compile it I get numerous errors of the form xyz.cpp(nnn): warning C4273: '<somefunction>' : inconsistent dll linkage I have other DLLs that have...
5
by: Andy Fish | last post by:
Consider the following code fragment public class Wrapper { protected enum E { IN, OUT }; public class C { protected void foo(E e) { } } } I want the class C to be accessible from outside...
0
by: Corey | last post by:
hello, I’m trying to run a query and I’m getting error messages Can anyone help me get though this problem? 1: Tried this and got this error message ORA-00923 , decode...
1
by: Sandeep Singh | last post by:
Hi, How to do group by in XSLT ? I tried on the following codes: <files> <file name="swablr.eps" size="4313" project="mars"/> <file name="batboy.wks" size="424" ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.