我想知道我是否正确解码了这个SQL逻辑。下面是在SQL:需要验证我理解SQL逻辑
,[hrs].[Hours] - SUM(CASE WHEN [UnitState].[UnitStateType] <> 'ACTIVE' THEN [Allocation].[AllocatedEnergyMwh] ELSE 0 END/CAST([Unit].[NetDependableCapacity] AS FLOAT)) AS SH
我解释这话说:
if [UnitState].[UnitStateType] does not equal active then SH equals the sum of [Allocation].[AllocatedEnergyMwh]/
(float)[Unit].[NetDependableCapacity].
else SH = [hrs].[Hours]
谢谢你的帮助 –