SAP Knowledge Base Article - Preview

2016260 - [SAP IQ] A SQL failed to run due to "Invalid use of an aggregate function" Error.

Symptom

When a Query is executed with aggregation function such as count, sum in subquery, "Invalid use of an aggregate function" Error is returned.

[Query]

  select T.c1, T.c2 
  from (select c1, (select count(c2) from gjang) as c2 from gjang ) T;

[Error]

  I. 05/13 15:23:07. <,227,PREPARE,select T.c1, T.c2  from (select c1, (select count(c2) from gjang) as c2 from gjang ) T
  I. 05/13 15:23:07. >,227,PREPARE,852052
  I. 05/13 15:23:07. E,227,-150,Invalid use of an aggregate function


Read more...

Environment

SAP IQ 12.7, 15.4, 16

Product

SAP IQ 16.0 ; SAP Sybase IQ 15.2 ; SAP Sybase IQ 15.4

Keywords

aggregation, subquery, scalar, invalid, Invalid use of an aggregate function, aggregate function, IQ , KBA , BC-SYB-IQ , Sybase IQ , BW-SYS-DB-IQ , BW on HANA with Sybase IQ Near-line Storage , Problem

About this page

This is a preview of a SAP Knowledge Base Article. Click more to access the full version on SAP for Me (Login required).

Search for additional results

Visit SAP Support Portal's SAP Notes and KBA Search.