Quantcast
Channel: Teradata Forums - All forums
Viewing all articles
Browse latest Browse all 27759

Get question on Sum function in TD - forum topic by xiangpzhang

$
0
0

hi, I am a layman in TD, and come across a Sum function issue.
sel
created_date (format 'YYYY/MM') (char(7)) as month
,count(*) as overall
,sum(table1. amount) as overall_amount
,sum(case when table1.amount > 300 then 1 else 0 end) as over_300_cnt
 
that's a part of my SQL,
and result come with 3 columns, but i want to get 4 columns, the 4th is the over_300_amt
how to use SUM function or other query?
thank u
 
 

Forums: 

Viewing all articles
Browse latest Browse all 27759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>