Skip to content
Advertisement

How do I update “case when” kogi mosi [closed]

I already have a table with some sample data. When I execute this I get: Error converting data type varchar to numeric.

Advertisement

Answer

Aside from the issue you have of trying to update the same column you are comparing with using a string data type, what you should probably consider is either putting this logic in a view, or you could add a computed / generated column.

The syntax might vary [slightly] depending on your RDBMS.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement