Select qwe.sku_id, qwe.mnfctr_cd, qwe.itm_desc, qwe.itm_type_cd,
sum (qwe. totalSold) as totalQtySold, qwe.MonthNum, qwe.Year_
Select item.sku_id, item.mnfctr_cd, item.itm_desc,
item.itm_type_cd, sale.sold_qty as totalSold,
extract (month from item.eff_bgn_dt_tm) as MonthNum,
extract (year from item.eff_bgn_dt_tm) as Year_
from edwviews.sku_poss_trans_ln_itm sale
inner join edwviews.itm item
on sale.sku_id = item.sku_id
where qwe.itm_type_cd like any ('A', 'P')
group by 6,1,2,3,4,7
Based on your query you get sales of all the years data for each month and for each product.
It is sounding you are expecting only choosen year sales. does it mean you want to filter the data for a specific year only by using year in "where condition" ?
or probably you want to aggreate the sales of all the products monthly wise. Then need to eliminate product level details in select clause and group by clause.
Hope i unders stood your requirement correctly
Check if this works out....
Select qwe.Year_, qwe.MonthNum, qwe.mnfctr_cd, sum (qwe. totalSold) as totalQtySold
group by 1, 2, 3
Correct me if something is wrong :)
How to move oracle data into teradata..if do you have any documentation please share with me ..please am strugle on this teradata..
this looks odd. This generally happends when the object name (tablename or column name) contains more than 30 character during DDL operation
@Kartheek, Teradata does not support RR format. Also the max timestamp allowed is timestamp(6). If you need to convert RR notation you need to cast that column in character and then add the century and then insert.
@Denise, what your query is taking is the item's effective begin dt time which is always a single date and you will get only the month and year of the day when the item was launched. what you need to take into consideration is the sale date from sku_poss_trans_ln_item table. then you will get the sum(sales).