0 - 5 of 5 tags for derived table
with drvd_amts (acct_nbr, grp_br_ps_org_id, PSAmt)
sum(d.pstd_ttl_amt) as PSAmt

from psfs.ps_gl_acct_ldgr d
where d.fiscal_yr_mth_nbr between 201500 and 201508
and d.acct_nbr between 130500 and 160500

group by d.grp_br_ps_org_id, d.acct_nbr) 


Hi everyone,
I'm trying to create a derived table that has a dimension that calculates either next row's value or the previous row's value (next or previous doesn't matter).

I am trying to use SSRS to pass parameters into a derived table in Teradata. The parameters represent a SQL Server table that is about 1600 rows. 
The join I'm trying is
 JOIN (Select ? (varchar(4)), ? (varchar(4))) as derivedtable (Col1Name, Col2Name) on (Col2Name=TDcol)

Hi Gurus,

I am looking for some guidelines on when to use each of the following form of temporary tables:

1) Derived Table

2) Volatile Table

3) Global Temporary Table

Any pointers will really help.


We stumbled upon this by accident. We have a query that runs much faster when a group by is added to a derived table when one of the columns in the derived table is the result of a cast/concatenation operation.

The first query/explain posted below has the group by in the derived table. It shows the cast/concatenation being resolved when the derived table is materialized in step 2 in the EXPLAIN. Result is 761 rows and I assume 761 resolutions of the cast/concatenation. The group by does not eliminate any dups.