Quantcast
Channel: Teradata Forums - Database
Viewing all articles
Browse latest Browse all 14773

required to get the records for last 6 months - response (14) by Kawish_Siddiqui

$
0
0

Are you looking something like this:

 

What I could understand from question is, you have two seperate tables and want to sum a column value based on Order_Date filter (last six months) by joning two tables on Opportunity_ID.... Am I right?

 

In this case, SQL will look like this.

Select Sum(OPP.Expected_Amount)
From Opportunity OPP
Inner Join Sales SL
On OPP.Opportunity_ID = SL.Opportunity_ID
Where SL.Order_Date >= add_months(current_date,-6)

 

 


Viewing all articles
Browse latest Browse all 14773

Trending Articles



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