I have a case statement, however; I’m getting two erros. I can’t seem to find the answer to the fix the errors.
SELECT #TMP.webid_Val = CASE #TMP.webid
when 'NULL' then 'NOT COMPLIANT'
else 'COMPLIANT'
end
FROM #TMP
**Incorrect syntax near FROM. Expecting CONVERSATION
Incorrect syntax near =**
#TMP is the temporary table.
webid is the value to be looked at for the condition
webid_val is the column who’s value will be changed.
Any help would be appreciated.
(The following answer assumes Sql Server)
You cannot do an update with a select statement.
If you are trying to return data to a client application or user, use
or if you’re trying to update data in the original temp table, use the following: