Formula Line change query

 

SELECT * FROM FM_MATL_DTL WHERE FORMULA_ID=(select FORMULA_ID FROM FM_FORM_MST WHERE FORMULA_NO='941306') AND RELEASE_TYPE='1'

update FM_MATL_DTL set LINE_NO=3  WHERE FORMULALINE_ID='799366' and FORMULA_ID='66980' AND RELEASE_TYPE='1';

update FM_MATL_DTL set LINE_NO=1  WHERE FORMULALINE_ID='799367' and FORMULA_ID='66980' AND RELEASE_TYPE='1';

update FM_MATL_DTL set LINE_NO=2  WHERE FORMULALINE_ID='799366' and FORMULA_ID='66980' AND RELEASE_TYPE='1';

delete from FM_MATL_DTL where FORMULALINE_ID='785344' and FORMULA_ID='65865' AND RELEASE_TYPE='1';




update FM_MATL_DTL set LINE_NO=3  WHERE FORMULALINE_ID=(SELECT FORMULALINE_ID FROM FM_MATL_DTL WHERE FORMULA_ID=(select FORMULA_ID FROM FM_FORM_MST WHERE FORMULA_NO='866642') AND RELEASE_TYPE='1' AND LINE_NO='1') AND RELEASE_TYPE='1' AND LINE_NO='1';

update FM_MATL_DTL set LINE_NO=1  WHERE FORMULALINE_ID=(SELECT FORMULALINE_ID FROM FM_MATL_DTL WHERE FORMULA_ID=(select FORMULA_ID FROM FM_FORM_MST WHERE FORMULA_NO='866642') AND RELEASE_TYPE='1' AND LINE_NO='2') AND RELEASE_TYPE='1'  AND LINE_NO='2';

update FM_MATL_DTL set LINE_NO=2  WHERE FORMULALINE_ID=(SELECT FORMULALINE_ID FROM FM_MATL_DTL WHERE FORMULA_ID=(select FORMULA_ID FROM FM_FORM_MST WHERE FORMULA_NO='866642') AND RELEASE_TYPE='1' AND LINE_NO='3') AND RELEASE_TYPE='1'  AND LINE_NO='3';


Comments

Popular posts from this blog

Formula list