Is't possible to check the condition using "IF else or else if" statement in set block of update command in SQL?
I know the case statement to check the conditions in set block of update clause. i want to know is't possible to write IF statements to check the conditions in set block of update clause. if it possible please send the examples.
for example the table name product. it has columns like route,product group, state. i have to update the route columns based on the productnumber and state column values.
If productNumber 12 or 44 then route to 'A'
· If productNumber 04 or 16 and
state is ‘HYD’, ‘MP’, then route to 'B'
· If state is 'TPT' then route to 'C'
except nursing - 'D'