You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Step 1 : Create output table with no data and index on(field1,field2)
CREATE volatile table my_table AS (
SELECTt1.field1,
t1.field2,
t1.field3,
t1.field4FROMschema.table1 t1
inner join table2 t2 ont1.key=t2.keywheret1.field4=2
qualify rank () over ( partition by t1.field1, t1.field2order byt1.field4 ) =1
)
WITH NO DATA PRIMARY INDEX (field1,field2) ONCOMMIT PRESERVE ROWS;
Step 2: Insert the data into output table
insert into my_table
SELECTt1.field1,
t1.field2,
t1.field3,
t1.field4FROMschema.table1 t1
inner join table2 t2 ont1.key=t2.keywheret1.field4=2
qualify rank () over ( partition by t1.field1, t1.field2order byt1.field4 ) =1
Create Permanent in Teradata. Retrieve with SAS.
Step 1 : Create permanent table
createtableschema.table as (
Select field1,
field2
fromschema.table1 a
joinschema.table2 b ona.field=b.fieldjoinschema.table3 c onc.field=b.fieldwhere1=1anddate='2018-12-10'and field>=0and field <>'VAD VAL'andtime>0)
WITH DATA PRIMARY INDEX ( field1 ) ;