select
ID,
[MinVal] = (
select
min(x)
from
(
select x=A where A > 0 union all
select x=B where B > 0 union all
select x=C where C > 0
) m
)
from
#MinAmt
order by
ID
Results:
ID MinVal
----------- -----------
1 1
2 4
3 2
4 1
5 2
6 1
(6 row(s) affected)