我想將計算列添加到SQL Server 2008 Express表。計算列 - 關鍵字'附近時語法不正確'
其計算公式爲:
case when callrecord_contacttype=1 then 'Routed voice'
else when callrecord_contacttype=2 then 'Direct incoming voice'
else when callrecord_contacttype=3 then 'Direct outgoing voice'
else when callrecord_contacttype=4 then 'Direct internal voice'
else when callrecord_contacttype=5 then 'Routed callback'
else when callrecord_contacttype=6 then 'Routed email'
else when callrecord_contacttype=7 then 'Direct outgoing email'
else when callrecord_contacttype=8 then 'Routed chat' else '' end
但我得到的錯誤:
Incorrect syntax near the keyword 'when'.