sql - Water Fall Logic via use of Update -


data been hosted in ##yomaster (temp table) , i'm using updates on water fall logic.

current water fall logic has 3 components , share following: ever date used, such date , field name inserted following 2 fields> statuscode location & startclockdt2 fields

::: phase 1:::

>  if date found on step 1 use date. (else use phase 3) > if no date found on step 1 move step 2 (else use phase 3) > if no date found on step 2 move step 3 (else use phase 3) > if no date found on step 3 move step 4 (else use phase 3) > if no date found on step 4 move step 5 (else use phase 3) > if no date found on step 5 move step 6  

:::phase 2:::

> if dates found on step 2 , 3 choose 1 max date 

:::phase 3:::

> if step 6 shows max date out of other steps, use date , apply statuscode location & startclockdt2 fields. 

note: 1st phase of logic working, need query handle phase 2 , 3.

here current code been used 1st phase.

update ##yomaster set statuscodelocation='no date',startclockdt2 = null  update ##yomaster set statuscodelocation='uno', startclockdt2=uno uno not null  update ##yomaster set statuscodelocation='dos', startclockdt2=dos dos not null , startclockdt2 null  update ##yomaster set statuscodelocation='tres', startclockdt2=tres tres not null , startclockdt2 null  update ##yomaster set statuscodelocation='cuatro', startclockdt2=cuatro cuatro not null , startclockdt2 null  update ##yomaster set statuscodelocation='cinco', startclockdt2=cinco cinco not null , startclockdt2 null  update ##yomaster set statuscodelocation='seis', startclockdt2=seis seis not null , startclockdt2 null  update ##yomaster set startclockdt2=null statuscodelocation='no date' 


Comments

Popular posts from this blog

python - How to create a legend for 3D bar in matplotlib? -

java - Multi-Label Document Classification -

php - Dynamic url re-writing using htaccess -