我想知道这个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]