想知道下面的查询有什么问题吗?我的SQL Case Query有什么问题
case
b.transaction_id,
when b.total_discount<0 then (ABS(b.total_discount)/(b.total_revenue + ABS(b.total_discount)) else '0' end as pct_discount_off
from transaction b
出现错误消息。
Msg 156, Level 15, State 1, Line 27
Incorrect syntax near the keyword 'end'
缺少 ')'。 ABS(b.total_discount))) –