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

Get question on Sum function in TD - response (1) by shilpa1

$
0
0

Following query can be used -
SEL
created_date (FORMAT 'YYYY/MM') (CHAR(7)) AS MONTH
,COUNT(*) AS overall
,SUM(table1. amount) AS overall_amount
,COUNT(CASE WHEN amount>300 THEN 1 END) AS over_300_cnt
,SUM(CASE WHEN amount>300 THEN amount END) AS  over_300_amt
FROM table1
GROUP BY 1
-Shilpa


Viewing all articles
Browse latest Browse all 27759

Trending Articles



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