Trying to get the result in single row using sql?

前端 未结 5 1451
后悔当初
后悔当初 2021-01-29 15:00

I\'m trying to display all the employee id\'s

i need the result like

emp_id

10,11,12,13,14,15..,...

when tried

5条回答
  •  没有蜡笔的小新
    2021-01-29 15:52

    try this

     declare @empid nvarchar(500)=''
        select @empid=@empid+Emp_id + ',' from tblemployee
        select substring(@empid,0,len(@empid)-1)
    

提交回复
热议问题