I am pulling out info from my db and need to tjeck if a column is 0, if it is then i need to SUM 3 other columns and pull out that total.
I want to use the CASE keyword and tjeck for this, but am doing something wrong, as I keep getting an error.
This is my code:
$sql = SELECT pris, skin_year, ialt, CASE ialt WHEN 0 THEN ialt = SUM('ær,vedrur,lamp') END FROM skind_statistik WHERE kunde_id = x Gives my a syntax error..
Ialt default value is set to zero, and the datatype is an integer.