What's wrong with this DB2 SQL Query? -
select getorgname(bc.manageorgid), count(case when (exists (select fo.objectno flow_object fo fo.objectno=cr.serialno) , nvl(cr.finallyresult,'') in ('01','02','03','04','05')) bc.manageorgid else null end) business_contract bc, classify_record cr cr.objecttype='businesscontract' , cr.objectno=bc.serialno group bc.manageorgid, cr.serialno, cr.finallyresult the error message receive is:
11:01:32 [select - 0 row(s), 0.000 secs] [error code: -112, sql state: 42607] db2 sql error: sqlcode=-112, sqlstate=42607, sqlerrmc=sysibm.count, driver=3.57.82 ... 1 statement(s) executed, 0 row(s) affected, exec/fetch time: 0.000/0.000 sec [0 successful, 0 warnings, 1 errors]
"the operand of column function name (in case, count) includes column function, scalar fullselect, or subquery." db2 doesn't allow this. see documentation on sql112 more.
i'm not sure how fix query perhaps can try having clause after group by.
Comments
Post a Comment