Hello,
So i want to use the INSERT OR UPDATE command so i can update a COUNTER for a given name:
INSERT OR UPDATE myTable
SET name='Omer', counter = counter + 1;
as you can see with the above code - if the row is non-existent then we get an error because COUNTER is NULL!
I tried the following to fix this but all have failed:
INSERT OR UPDATE myTable
SET name = 'Omer',
counter = CASE
WHEN counter IS NULL THEN 1
ELSE counter + 1
END
INSERT OR UPDATE myTable SET name='Omer',counter = COALESCE(counter + 1, 1)
Hello!.png)
