请教在查询中怎么转换字符类型
比如 userinfo表中有一个nvarchar字段UName,我要在查询后返回成text类型,应该怎么写呢?
select '用户名'+UName as (此处希望返回text的类型) from userinfo
------解决方案--------------------
试试:select convert(text,'用户名'+UName) as xxx from userinfo
select '用户名'+UName as (此处希望返回text的类型) from userinfo