sql - Set flag to database column -


The job is creating SQL scripts that make "Y" or "N" the dummy database line "integer" < p> is the solution

  Setting Status Status Flag = "Y" where plus = '5' and set position Flag = "N" where plus = '100'   

Newbie in SQL Scripting

  updated people to SET status = case when money = '5' then 'y' when money = '100' Position of 'N' basis where 'money' ('5', '100')   


<

WHERE section ensures that only the row you want to update It is updated, it is updated.

  • case statement then to set status based on the current value in plus Which standard does you choose?

  • ELSE should never be blocked, but it is a fail-safe (even when you run it Then the value of the currency is set to any value in the position , where plus '5' or '100' ) is neither.


    Edit:

    Note:

      people should be named < table

    • < The name of the code> status should be field


      Last edits (I leave now): Update the SET status to the people = Case when money & gt; 10 Then 'y' and 'n' end;

      This will update the every line in people .

      It will be set to position to 'y' if plus & gt; 10 , for all other records it will set position to 'n' .

  • Comments

    Popular posts from this blog

    Java - Error: no suitable method found for add(int, java.lang.String) -

    java - JPA TypedQuery: Parameter value element did not match expected type -

    c++ - static template member variable has internal linkage but is not defined -