I want to update a Table1.class column with Table2 tables data with inner join with condition that When age<=10 then 2 else 2, and I am using below query but it is giving me an error message that
update Table1 set class= case t.age <= 10 then 2 else 3 end from Table1 v inner join Table2 t on v.id=t.id
Msg 170, Level 15, State 1, Line 4 Line 4: Incorrect syntax near '<'.
Table 1 id subject class 100 B NULL 100 E NULL 100 R NULL 101 R NULL 101 K NULL 101 A NULL 102 Z NULL 102 L NULL 102 N NULL 102 O NULL