如何在Sql StoredProcedure中连接两个整数列? [英] how to concatenate two integer columns in Sql StoredProcedure?
本文介绍了如何在Sql StoredProcedure中连接两个整数列?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在Sql StoredProcedure中连接两个整数列?
how to concatenate two integer columns in Sql StoredProcedure?
推荐答案
SELECT CONVERT(VARCHAR,intfield1)+ CONVERT(VARCHAR,intfield2)FROM sometable
SELECT CONVERT(VARCHAR, intfield1) + CONVERT(VARCHAR, intfield2) FROM sometable
选择强制转换(@ Num1 as varchar)+ cast(@ Num2 as varchar)
Select cast(@Num1 as varchar) + cast(@Num2 as varchar)
查看此查询
.....
See this query
.....
Declare @Num1 int,@Num2 int
set @Num1=50
set @Num2=100
select (convert(varchar,@Num1)+convert(varchar,@Num2)) as Sum
Nirav Prabtani
这篇关于如何在Sql StoredProcedure中连接两个整数列?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文