我需要将col代理转换为小整数和nee以带来col代理的绝对值。 我知道如何分开但不在一起。
select
cast (a.AGENT as smallint) as agent,
abs (a.AGENT)
from Table
答案 0 :(得分:0)
您需要重复cast()
,我认为:
select cast(a.AGENT as smallint) as agent, abs(cast(a.AGENT as smallint))
from Table;
答案 1 :(得分:0)
这将返回一列:
abs(cast (a.AGENT as smallint)) as agent