How do I update every column in a row if a certain condition in the column is met? Say if the status column of that row is 'underReview', then update the whole row with the request body. If the status column has other values, then do not execute the SQL query? I am using v8 btw.
I have tried the query below but it shows error.
IF ((SELECT status FROM tableName) = "underReview" WHERE id = ?)
THEN
UPDATE tableName
SET columnA = ?, columnB = ?, columnC = ?, columnD = ?
WHERE id = ?;
END IF