在case语句中包含计算表达式

时间:2017-08-10 15:16:23

标签: sql-server-2012 ssms

如何在我的case语句中使用我命名为QTY的表达式?

cast(((iloc.qty_on_hand) - (iloc.qty_allocated) - (ilocss.qty_non_pickable) - 
(ilocss.qty_quarantined) ) / ( item_uom.unit_size ) as decimal (10,2)) AS 
[QTY available],

case when (iloc.qty_on_hand) <= (iloc.inv_min) then (iloc.inv_max) - 
('QTY available') else 0 end as [Build]

0 个答案:

没有答案