标签: sql sql-server
我尝试了以下查询,但失败了:
select UserNo , TeamNo , TeamName = 'Team'+ TeamNo into TableB FROM TableA ;
答案 0 :(得分:0)
尝试使用as代替=。像下一个代码:
as
=
, 'Team'+ TeamNo as TeamName
答案 1 :(得分:0)
您可以使用以下查询:
select UserNo, TeamNo, 'Team' + CAST(TeamNo as varchar(10) As TeamName into TableB FROM TableA ;
在将数字列连接到另一列之前,最好将数字列转换为varchar。