select top 50 * from 成绩表;

来源:百度知道 编辑:UC知道 时间:2024/06/02 10:46:34
如何把(select top 50 * from 成绩表)得到的值付给变量N;

是多列结果集?

可以用XML


用字符串时,最好是针对一列。楼主列出数据格式看看
如:
declare @N nvarchar(max)

select top 50 @N=isnull(@N+',','')+Col from 成绩表
select @N

来自:求助得到的回答