mardi 11 décembre 2018

Syntax error executing if - else statement when else is equal to NULL

The column Old_Price is used to determine the column Increased_Price by adding 10% if Old_Price is less than $10 otherwise it's null.

SELECT Copy_Price, 
  IF (Old_Price < 10.00, 
      Increased_Price = (Old_Price + (Old_Price * 0.1))
  ELSE Increased_Price = NULL);

Aucun commentaire:

Enregistrer un commentaire