sql - Performing an Update query with a date -


can perform update query checking value of date whether date entered greater date stored in database.

if @input_date > table.date   update table set table.value = 0, table.date = @input_date else    update table set table.value = @input_value, table.date = @input_date 

use case statement

try this

    update table      set table.value = case when @input_date > table.date 0 else @input_value end,         table.date = @input_date 

Comments

Popular posts from this blog

java - Jasper subreport showing only one entry from the JSON data source when embedded in the Title band -

serialization - Convert Any type in scala to Array[Byte] and back -

SonarQube Plugin for Jenkins does not find SonarQube Scanner executable -