Inner Join using SubQuery bring me the table name

Database

Inner Join using SubQuery bring me the table name

Hi, i have a query:

sel Distinct
a.ccpf_cnpj,
a.account_modifier_num,
a.account_num,
a.cartao_01,
a.Telefone1,
a.Telefone2,
a.Telefone3,
b.disposition_cd
From
cnha_imp.REGUA_TLMKT_VAR_NET A
Inner Join
CNHA_CST.TRM1_10006td64847_10007371tk8l B
On a.ccpf_cnpj = b.ccpf_cnpj
And a.account_modifier_num = b.account_modifier_num
And a.account_num = Cast(Substr(b.cgerdr_catao_credt_campa ,0,12) As integer)

Table B is a table that always varies, the subquery must put in place under the table B.
This query gives me always the updated name of the table B
I do not know how.
Thank you.

SEL MAX(TRIM(Database_Name_Txt) || '.' || TRIM(Table_Name_Txt))
FROM (
SEL *
FROM cnha_cst.rt_segment_header A
INNER JOIN CNHA_COR.SM_LOGICAL_SEGMENT B
ON A.LOGICAL_SEGMENT_ID = B.LOGICAL_SEGMENT_ID
WHERE B.Segment_Plan_ID = '10006td6483q'
) x
1 REPLY
Teradata Employee

Re: Inner Join using SubQuery bring me the table name

Can you please be more descriptive?