sql - CASE statement in update -


I have a scenario here where I am running 2 different update queries. By using the case, How can I add to the question?

  Update Table 1 SET ACTV_IND = 0 where is the name (NAME is selected by NAME, where SID = 'child' is going to be MAX MAX CAST (INT as ACTV_IND) = 0 ) And SID = 'original'   
  update table 1 SET ACTV_IND = 1 where is the name (select NAME from tab3 where SID = 'child' by NAME MAX (CAST (ACTV_IND) INT) = 1) AND SID = 'parent'    

Question 1: I suppose That this solution can be done

  ACTV_IND = MAX (CAST (ACTV_IND INT))   

Question 2: This is to be included for updates It is possible

  Update T1 SET T1.C1 =: Val1 to TABLE1 T1 in table T2 ON T1.KEY1 = T2.KEY2   

I will try to do something like this, assuming that MAX ( Select DATA_SOURCE (NAME, VAL) AS (NAME, MAX (CAST () as ACTV_IND INT) with CAST (ACTV_IND INT) 0 or 1

 ) from TABLE to VAL where SID = Group 'NAME' by group UPD ATE Table 1 SET ACTV_IND = DSLL From TABLE 1 T1 JOIN DATISISER DS ON T 1.NAME = DSN.NYHEET 1 sid = 'parent' geo    

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -