Set column values based on condition statement
The syntax for case is not correct and the datatype is Boolean, so you must set it as True or False


CREATE TABLE smartcardtable (&quot;ID&quot; INT, &quot;board_stage&quot; int,&quot;alight_stage&quot; int )




INSERT INTO smartcardtable VALUES (1,1,2)




ALTER TABLE smartcardtable
ADD service_direction boolean;




UPDATE smartcardtable
SET service_direction = 
CASE WHEN board_stage &lt; alight_stage THEN  TRuE
ELSE FALSE END;


1 rows affected




SELECT * FROM smartcardtable


ID | board_stage | alight_stage | service_direction
-: | ----------: | -----------: | :----------------
 1 |           1 |            2 | t                


db&lt;&gt;fiddle here