且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

从多列检索数据

更新时间:2023-11-18 23:05:22

试试这个
select no,username,role1 +','+role2+','+role3 as ROLE from UserData



如果您需要将数值数据类型与varchar数据类型组合,那么您需要使用此


in case you need to combine a numeric data type with varchar datatype then you need to use this

select no,username,cast(no as varchar)+','+role1 +','+role2+','+role3 as ROLE from UserData