Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

SQL UPDATE JOIN to another table Teradata

BoilerBob88
5 - Atom

My Teradata SQL has a volatile query that I was able to mimic in Alteryx.  I am having trouble UPDATING the data using information from another table.  I can join OK, but not sure how to make sure the date range in join from DATA_Orig (previously my volatile table) is withn the NewDataUpdate date range nor how to restrict in the join to UPDATE only those that have a rating and are not in CA:

 

UPDATE DATA_Orig
FROM  NewDataUpdate ND
SET Rating = ND.Rating
WHERE 
    Provider = ND.Provider
    AND ST_CDE = ND.State 
    AND serviced_dte BETWEEN ND.eff_dt AND ND.end_dt
    AND St_CDE NOT IN ( 'CA')
    AND ND.Rating <> 0 ;

 I tried joining then removing cartesian product via dates but that did not work and did not seem efficient.  This is my first community question and I am hoping question clear enought.  Thanks in advance.  

1 REPLY 1
ccasijr
5 - Atom

Here are the steps to solve your issue:

1. Add all of your SQL including the updates that you are performing in the Pre SQL Statement under options.

2. Under Table or Query add your SELECT statement.
3. Continue with your workflow based on the data retrieved in step # 2.

 

Best Regards,

ccasijr

 

Labels