 |
 |
Archives of the TeradataForum
Message Posted: Thu, 24 Mar 2005 @ 18:55:18 GMT
Subj: | | 3504: selected non-aggregate values must be part of the associated group |
|
From: | | Karra, Krishna |
Hi,
Can someone tell me what am I doing wrong in the SQL below, and the error that I am getting when I run this sql is "3504:selected no-aggregate
values must be part of the associated group"
select pngb.acct_ach_fin_instun.fin_instun_id,
pngb.acct_ach_fin_instun.acct_num, sum(pngb.fin_trxn_acct_evt.trxn_amt)
debit_trxn
from pngb.acct_ach_fin_instun
join pngb.evt on pngb.acct_ach_fin_instun.acct_num =
pngb.evt.acct_num
join pngb.fin_trxn_acct_evt on pngb.evt.evt_id =
pngb.fin_trxn_acct_evt.evt_id
where cast(pngb.fin_trxn_acct_evt.load_ts as date) >= date - 60
and cast(pngb.fin_trxn_acct_evt.load_ts as date) < date
and pngb.fin_trxn_acct_evt.trxn_data_type_cd = 'D'
group by pngb.evt.acct_num
having debit_trxn <= -5000
Thanks
Krishna
| |