My question is why doesn't Teradata have a way (or I don't know how to) so that I can execute the top query which has a calculated column and then I can write another select statement to just query that one calculated column along with other variable char columns I need without querying the caluclated column's independent variables. I tried volatile tables did not work.
And I cannot just select the columns I want as I was told prior by some contributors because the calculated column cannot be queried and made to show just that without showing all of its independent columns too in the view.
Any expertise would be of great help.
Query I have :-
select p.n_cd, p.htc, p.ctry, p.region, h.item_cd, h.rgn_nm, c.yr, c.mo_nbr, nullifzero( p.curr_qty-p.pre_qty+p.canc_qty) as pro_qty
from pci.sum_pit as p
pci.region as h
inner join pci.ctry as ctry
where p.ctry_cd = 'xyz'
Query I want possibly from the top query:-
select p.n_cd, pro_qty
from whatever table
This should help to get subset of the main query: